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

Cannot Use Reflux Components With React getDerivedStateFromProps() Static Method #549

Open
tgv1975 opened this issue Jul 13, 2018 · 3 comments

Comments

@tgv1975
Copy link

tgv1975 commented Jul 13, 2018

React 16.4.1
Reflux 6.4.1


On components that extend Reflux.Component, if I use

static getDerivedStateFromProps(props, state) {...}

without implementing componentWillMount() (which is now UNSAFE in React), the Reflux functionality in the component fails, and I get a console error:

image

In the screenshot, below the error, I printed this.componentWillMount from the component's render() method, attesting it comes from the Reflux.Component implementation.

In summary, due to implementing a now UNSAFE componentWillMount(), Reflux.Component cannot be used with the new static method getDerivedStateFromProps().

@TwR-Slice
Copy link

also, my observation is that if you use getDerivedStateFromProps the Store will not mix its state into a Reflux Component.

@tgv1975
Copy link
Author

tgv1975 commented Oct 10, 2019

@TwR-Slice This library hasn't been updated in more than a year. I have stopped using it since. Probably worth investigating other Redux solutions.

@TwR-Slice
Copy link

@tgv1975 Sad to see this lib decay, always liked the simplicity of it.

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