Error message improvement for multiple React instances scenario.
The issue reports a misleading error message when hooks are used with multiple React instances. The enhancement request is to detect and provide a more accurate error message in such cases. The main challenge is reliably detecting multiple React instances across different scenarios.
Do you want to request a feature or report a bug?
Enhancement
What is the current behavior?
I had multiple instances of React by mistake.
When trying to use hooks, got this error:
hooks can only be called inside the body of a function component
Which is not correct since I was using function components. Took me a while to find the real cause of the issue.
What is the expected behavior?
Show the correct error message. Maybe detect that the app has multiple instances of React and say that it may be the reason of bugs.
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!