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

something went wrong with react16.7 #46

Closed
Jemair opened this issue Oct 31, 2018 · 2 comments
Closed

something went wrong with react16.7 #46

Jemair opened this issue Oct 31, 2018 · 2 comments

Comments

@Jemair
Copy link
Contributor

Jemair commented Oct 31, 2018

i want to try hooks api with this boilerplate but something went wrong:

i have updated react@next & react-dom@next, and i can read state from useState
however when i called setState, nothing happended, the state didn't change.

Doubting its a HMR problem, but i tried changing export hot(module)(App) to export App, didn't help

may have a look if you have time. same code runs fine on cra
thanks

@SidKwok SidKwok added the bug label Oct 31, 2018
@SidKwok
Copy link
Owner

SidKwok commented Nov 2, 2018

It's related to this issue.

But you can disable react-hot-loader as a workaround by commenting some codes in these files:
App.jsx:

- import { hot } from 'react-hot-loader'
+ // import { hot } from 'react-hot-loader'
...
- // export default hot(module)(App)
+ export default App

.babelrc:

...
- "development": {
-     "plugins": ["react-hot-loader/babel"]
- }
...

Seems the collaborator has already started to draft a PR for the issue, and it will be fixed in the template as soon as RHL provide the patches.

@Jemair
Copy link
Contributor Author

Jemair commented Nov 2, 2018

awkward. i forgot to remove the babel-plugin.
thanks

@Jemair Jemair closed this as completed Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants