React State Hook(setState) Not Work
Hey guys，You may was attracted to React new feature: The Hooks. And just had a try with the latest react version：v16.7.0-alpha.
But wait! when you was about to use the latest api：
useState and set some state to change it but it didn’t work, WTF? You may start to doubt the life…
Yeah, I had just experienced such a thing today. So I want to write this for people who like me.
So check the webpack config in your repo:
new webpack.HotModuleReplacementPlugin() plugin config and the
webpack-hot-middleware entry config. Just remove it.
The react hooks useState, “setState” works! The may be a bug with webpack or react, so now the only way we can do is remove the HRM and wait or if you find the problem and solved it just pull request to them.