use-descendants icon indicating copy to clipboard operation
use-descendants copied to clipboard

Can't pass data through to useDescendants()

Open hilja opened this issue 3 years ago • 0 comments

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.

hilja avatar Jan 10 '22 07:01 hilja