Remove the use of UNSAFE_componentWillReceiveProps#7
Remove the use of UNSAFE_componentWillReceiveProps#7yoedfried wants to merge 2 commits intoGeekyAnts:masterfrom
Conversation
|
@yoedfried can you commit with changes? |
|
getDerivedStateFromProps is a static method so you cant reach this.props.style. |
|
Ohh my mistake. How does memoize works? |
|
memoize save the result of the function and return it back in case it called with the same vars. |
Use memoize instead of saving the style in the state like explained in this doc: https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#what-about-memoization