I wanted to share this thought with you cause I didn't give enough attention about differences between componentWillReceiveProps and getDerivedStateFromProps and IMHO this is kind of important.
I’m a full stack developer who has experience with several front-end tools like Reactjs, Vuejs, and jQuery as well as some back-end tools like PHP, Laravel, Node, and Express.
Location
IL
Education
AAS in Information Technology/Web Development
Work
Senior Software Development Engineer at Wizards of the Coast
Nice Article.
When I use getDerivedStateFromProps() in same way you use componentWillReceiveProps() in List component searching doesn't work.
static getDerivedStateFromProps(nextProps) {
return {
filtered: nextProps.items
};
}
I didn't know that getDerivedStateFromProps is called every time we setState(). Link for lifecycles projects.wojtekmaj.pl/react-lifecy....
I wanted to share this thought with you cause I didn't give enough attention about differences between componentWillReceiveProps and getDerivedStateFromProps and IMHO this is kind of important.
This is awesome! Thanks for the link!
Np. Thank you for the article