Cannot use functional components as "from"
See original GitHub issueDescribe the bug
Popover does not work when a functional component is supplied to the from
prop. Error message reads:
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
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
calculateRectFromRef - waiting for ref
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why I can't use an imported component inside a functional ...
I created a customed button 'addImageButton'and imported it to another .js file. It doesn't render the customer button when I try to use...
Read more >Why hooks are the best thing to happen to React
With React hooks, you can now do all these without switching, using functional components. Hooks make React so much better because you have ......
Read more >How to Use Functional Components in React - freeCodeCamp
Have you wondered how to create a component in React? To answer, it is as simple as creating a function returning an HTML-like...
Read more >How to use Syncfusion components with Functional ...
A functional component accepts props as an argument and returns a React element. You cannot use ref on functional components in React because...
Read more >Don't call a React function component - Kent C. Dodds
I ran into an issue where if I provided a function that used hooks in its implementation and returned some JSX to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Updated readme, added this under troubleshooting section.
I’m actually going to re-open this so that I remember to update the documentation to mention this. Thanks for pointing it out.