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

Issue with recompose's withStateHandlers (or maybe every enhancer) #717

Closed
fenok opened this issue Dec 12, 2017 · 4 comments
Closed

Issue with recompose's withStateHandlers (or maybe every enhancer) #717

fenok opened this issue Dec 12, 2017 · 4 comments

Comments

@fenok
Copy link

fenok commented Dec 12, 2017

Description

I'm starting a project and trying to use react-hot-loader and recompose together.

Expected behavior

When I alter contents of withStateHandlers enhancer, they should reflect in RecomposeCounter, or there should be error or warning in console.

Actual behavior

Hot reloading silently fails (props.stateCounter and props.incrementStateCounter in RecomposeCounter refer to old values). Manual page reload fixes it.

Environment

React Hot Loader version: 3.1.3

  1. node -v: v6.9.1

  2. npm -v: 3.10.8 (i don't use it)

  3. yarn -v: 1.3.2

  4. Operating system: win10, ubuntu

  5. Browser and version: Chrome 63.0.3239.84

Reproducible Demo

https://github.com/fenok/react-hot-boilerplate/tree/next
I.e. change sign in counter updater. It works fine in Counter, but silently fails in RecomposeCounter.

@theKashey
Copy link
Collaborator

We know > #650

@fenok
Copy link
Author

fenok commented Dec 12, 2017

It's not about losing state. It's about RHL saying the app is up-to-date when it's not.

@theKashey
Copy link
Collaborator

Usually, RHL ignores actions made on componentDidMount, as long there will be no mount/unmount.
And it also ignores any changes made inside the constructor. Changing the stateUpdaters will affect only new instances. That's how react-proxy, the underlying internals of RHL works.

Will be solved by #707. The new version does regenerate changes from constructor in runtime.

@fenok
Copy link
Author

fenok commented Dec 12, 2017

Awesome, thank you!

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