formcarry / formcarry-react Goto Github PK
View Code? Open in Web Editor NEWReact library of https://formcarry.com
React library of https://formcarry.com
I've just installed @formcarry/[email protected]
. When I run my app I see the following error from React.
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
I think this is being caused by problem 3 in the list, i.e. two copies of react. Reading the linked documentation it suggests running npm ls react
to see which versions of react are installed in the deps tree. Running that shows me this.
├─┬ @formcarry/[email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected]
├─┬ @netlify/[email protected]
│ └─┬ @sls-next/[email protected]
│ └─┬ @aws-sdk/[email protected]
│ └─┬ @aws-sdk/[email protected]
│ └─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ @next/[email protected]
│ │ └── [email protected] deduped
│ ├── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
└── [email protected]
Which does show that there are two versions of react installed at different versions.
I think @formcarry/react
should have a peer dependency on react
instead of a hard dependency to avoid this duplication issue. This SO answer supports this as the correct fix too.
I'll open a PR now to change it over as it should be straight forward.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.