can't use hooks inside of component.
See original GitHub issueI’m experimenting with the library ( Great effort by the way ).
however I’m somehow unable to use React.useContext
inside of screen component.
export const stateNavigator = new StateNavigator([
{key: 'hello'},
{key: 'world', trackCrumbTrail: true},
]);
const {states} = stateNavigator;
states.hello.renderScene = Hello;
states.world.renderScene = World;
function Hello(){
React.useContext(...)
///
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Invalid Hook Call Warning - React
Hooks can only be called inside the body of a function component. There are three common reasons you might be seeing it: You...
Read more >React hooks - Can't use hook inside plain async function?
Hooks can only be called inside the top level of the body of a function component. Read the official documentation. Share.
Read more >You Can't Call Hooks Inside Conditions? Yes you can
Calling hooks conditionally breaks the rules, yes. Wrap the hook with a component and render that component optionally to toggle the usage of ......
Read more >Invalid hook call. Hooks can only be called inside the body of ...
The error "Invalid hook call. Hooks can only be called inside the body of a function component" occurs for multiple reasons, having a...
Read more >"Hooks can only be called inside the body of a function ...
"Hooks can only be called inside the body of a function component" ReactJS Error · You may have mismatching versions of React and...
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 Free
Top 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
@grahammendick thank you.
This is what you’re after