Howard H

Results 6 comments of Howard H

I'm doing it here using setStatic https://github.com/acdlite/recompose/issues/648 , it is working like the old componentWillReceiveProps lifecycle, but get warning in console. FYI, I am initializing state in my withReducer, `reducer`...

I see what you meant about setStatic, and thank you very much for the example. Using a `getDerivedStateFromProps` HOC with recompose like this: derivedStateFromProps HOC: ``` const derivedStateFromProps = (initialState,...

@istarkov do you think recompose should have a getDerivedStateFromProps HOC since it's now a static instead of using the deprecating componentWillReceiveProps in the lifecycle HOC? Thanks.

That make sense... then can probably deprecate setStatic too.

Yes, state get pass through as props, so that's the first initialState argument which takes the state name in props as a string, or you can pass your own state...