Giter Site home page Giter Site logo

formcarry-react's People

Contributors

choc13 avatar dependabot[bot] avatar nusu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

thevovj

formcarry-react's Issues

Invalid Hook Call

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.