reflux / refluxjs

A simple library for uni-directional dataflow application architecture with React extensions inspired by Flux
BSD 3-Clause "New" or "Revised" License
5.36k stars 330 forks source link

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

Open tgv1975 opened 6 years ago

tgv1975 commented 6 years ago

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 commented 5 years ago

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

tgv1975 commented 4 years ago

@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 commented 4 years ago

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