You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.
I'm developing a library which uses useState and useEffect hooks using the react-component nwb template. It works great in the demo/ app.
I tried using $ yarn link to test my library in an app, and I get Invalid hook call. Hooks can only be called inside of the body of a function component.
I'm new to React, so I assumed I must be doing something wrong with my build, so I started looking around for examples. I found react-hooks-toolbox and decided to see how that's configured. I added it as a dependency to my project, and confirmed that I could import the simplest hook defined in that project (useDebounce). That worked perfectly.
After that, I cloned the repo, installed deps, ran $ yarn build and linked it up. At that point, my app started throwing the same Invalid hook call on the useDebounce hook.
This issue is a: Bug report
I'm developing a library which uses
useState
anduseEffect
hooks using thereact-component
nwb template. It works great in thedemo/
app.I tried using
$ yarn link
to test my library in an app, and I getInvalid hook call. Hooks can only be called inside of the body of a function component.
I'm new to React, so I assumed I must be doing something wrong with my build, so I started looking around for examples. I found react-hooks-toolbox and decided to see how that's configured. I added it as a dependency to my project, and confirmed that I could import the simplest hook defined in that project (
useDebounce
). That worked perfectly.After that, I cloned the repo, installed deps, ran
$ yarn build
and linked it up. At that point, my app started throwing the sameInvalid hook call
on theuseDebounce
hook.I'm using
[email protected]
for my lib, andreact-hooks-toolbox
is using[email protected]
.The text was updated successfully, but these errors were encountered: