Closed AdamGerthel closed 2 years ago
Solved by using React.forwardRef()
I'm actually going to re-open this so that I remember to update the documentation to mention this. Thanks for pointing it out.
Updated readme, added this under troubleshooting section.
Could someone please share a code example how to solve this with React.forwardRef?
Here are the generic react docs, including example: https://reactjs.org/docs/forwarding-refs.html
Just make sure to pass the ref to the outermost element, or the element that you want the popover to originate from.
Describe the bug Popover does not work when a functional component is supplied to the
from
prop. Error message reads:I don't know if this is intended behavior or not, and I'm not sure how to work around it.
Device/Setup Info: Any device, see snack: https://snack.expo.dev/@insats/sample-popover
Debug Output