React hook fails to compile
See original GitHub issueIn a CRA running React 17 attempting to use the react hook import { useAutoAnimate } from '@formkit/auto-animate/react'
results in the following error:
Failed to compile.
./node_modules/@formkit/auto-animate/react/index.mjs
Can't import the named export 'useEffect' from non EcmaScript module (only default export is available)
Not using the hook, and just using the autoAnimate
function in a useEffect does however work
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Failed to compile react hooks() - Stack Overflow
The rules of hook plugin uses naming conventions to tell what is a component, what is a hook, and what is a regular...
Read more >Invalid Hook Call Warning - React
You are probably here because you got the following error message: Hooks can only be called inside the body of a function component....
Read more >How to test React Hooks - LogRocket Blog
Hooks aim to solve all of these by enabling you to write reusable components with access to state, lifecycle methods, and refs. How...
Read more >Hooks error on React library compiled with Rollup.js #14721
I still need to add React as a devDependency and now I'm getting a different error if I use the production build (a...
Read more >FAQs | React Hook Form - Simple React forms validation
How to create an accessible input error and message? React Hook Form is based on Uncontrolled Components, which gives you the ability to...
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
My Quick Fix: Instead of importing from “”@formkit\auto-animate\react", direct copy and paste it into your own codebase.
Hello,
I use on webpack this configuration and it’s works !
😃