"Invalid hook call" occurred when add kotlin-styled to dependencies
See original GitHub issueI wrote functional component using hooks like this
val component = functionalComponent<RProps> {
val (inputText, setText) = useState("")
textArea {
attrs.onChangeFunction = {
val target = it.target as HTMLTextAreaElement
setText.invoke(target.value)
}
}
div {
+ inputText
}
}
This code works, but when I add kotlin-styled dependency, this code crashed.
Here is a sample code. You can check by comment-out kotlin-styled dependency and running ./gradlew browserRun.
https://github.com/yt8492/kotlin-react-hooks-sample
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Invalid Hook Call Warning - React
You can only call Hooks while React is rendering a function component: ... incorrectly specifies react as a dependency (rather than a peer...
Read more >React hooks in react library giving Invalid hook call error
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the...
Read more >Solving React Hooks' invalid hook call warning - Rob Kendal
How to fix the invalid hook call warning. In a normal setup, you'll have a dependency pushed to some hosting repository, such as...
Read more >Error: Invalid hook call - Material Design for Bootstrap
Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1....
Read more >Invalid hook call - How to resolve multiple versions of React ...
react.development.js:209 Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen ...
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

@turansky I confirmed this problem resolved. Thank you!
I see. Thank you!