Can't use React hooks inside Konva component tree
See original GitHub issueIf I use a React hook inside the Konva component tree I’m getting the following error:
Hooks can only be called inside the body of a function component.
I’m using 16.8.0-alpha.1
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Render DOM elements inside a canvas stage - Konva
If you want to have some DOM nodes as part of your canvas tree you can use <Html /> component from react-konva-utils package....
Read more >reactjs - Error when use react-konva - Stack Overflow
I just install react-konva and read document follow to test some feature but can't use it. An error occurs in the component stage,...
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 >Make a diagram creation tool in React #2: Intro to React Konva
Code: https://codesandbox.io/s/quizzical-darwin-zhm7n?file=/src/App.js The google slide: ...
Read more >invalid hook call. hooks can only be called inside of the body ...
If you think back in the class component version, your code is calling this.setState in the render() ... Cant use Hooks with my...
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
I am going to wait for a public release of React, so we can update dependencies and have hooks support too. Please just wait.
Just made a prelease
16.8.0-1
with the support of Hooks.Please try it. Will publish with
latest
tag later.