react
react copied to clipboard
Bug: Error: Should have a queue. This is likely a bug in React. Please file an issue.
React version: 17.0,2
Steps To Reproduce
I'm rendering a useMemo that takes its value from a function that contains a hook (the hook uses recoil to manage global state) and switches its input to generate the component, then I have a useState that handles a boolean value. If I invert the order, another different error is thrown, saying that the number of rendered hooks is fewer than expected.
Link to code example: https://pastebin.com/K134AmZ2

The current behavior
Throws an error
The expected behavior
Handles the useMemo and useState properly