use-descendants
use-descendants copied to clipboard
Can't pass data through to useDescendants()
You can pass any data you want to useDescendant and it will be available in the parent through
map
I don't think that works, I just get an empty object. Or I'm using it wrong.
Maybe it was this line that was suppose to populate the map:
https://github.com/pacocoursey/use-descendants/blob/e7b0d7bfbd93a2aabdac58b69cde5aa72896e02a/index.js#L33
I couldn't immediately figure out how to do it, so I hacked useDescendant()
to return the context
. Worked for my case.