-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically set DropTarget type via the parent component #388
Comments
Actually, I just figured it out. Read the doco for the 5th time and finally understood what was meant by: DropTarget((props) => {return props.dropTargetType;}, target, collect)(ShopContainer); |
@mordrax I read it more than 5 times and never did get it. Now I do. |
@gaearon There should be an example like this in the docs and/or tutorial. Aside from that, I am finding them both excellent. |
@mordrax saved my day |
@nsuthar0914 I've moved on to Elm, give it a go, I might save you a week this time ;) |
In all the examples, I've seen a hardcoded DropTarget type, e.g
But what I'd like to do is for the parent component to pass down a type so I can reuse the container for other DropTarget types.
I'm currently trying to work around this by exporting multiple DropTarget containers, one for every type that I want.
The text was updated successfully, but these errors were encountered: