Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use fuse-react with React useState #4

Open
ost12666 opened this issue Apr 7, 2019 · 3 comments
Open

Can't use fuse-react with React useState #4

ost12666 opened this issue Apr 7, 2019 · 3 comments

Comments

@ost12666
Copy link

ost12666 commented Apr 7, 2019

Getting this error:

react-dom@16.8.6:373 Uncaught (in promise) Invariant Violation: 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

Used this example: https://github.com/konbu310/hooks-and-fusebox

And modified index.tsx to:

import * as React from "react";
import * as ReactDOM from "react-dom";
import { UseStateSample } from "./components/UseStateSample";
import { Route, Switch } from "fuse-react"

ReactDOM.render(

, document.getElementById("root") );
@nchanged
Copy link
Contributor

nchanged commented Apr 8, 2019

@ost12666 so, you have pretty much answered to the issue yourself. How can I help? That's not fusebox

@ost12666
Copy link
Author

ost12666 commented Apr 8, 2019

It started when I failed to use react router in my project because of strange error about failing to load prop-types. I then switched to fuse-react as a router. But then this error happened when I tried to use hooks. I ended up fixing all this by upgrading fro, fuse-box 3.7 to 4.0 to solve the prop-types problem and then using react router to solve the hooks problem. So I am good (except for several hours wasted) just wanted you to know...I love fuse-box!

@nchanged
Copy link
Contributor

nchanged commented Apr 8, 2019

@ost12666 good to know!!! btw v4 is coming to open test soon. There will be breaking changes, I will update all the issues, and notify everyone to help test the new product ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants