by hoodoof · 8y ago · 0 comments
You asked "Curious, what do you use it for?" in regard to componentWillReceiveProps
https://news.ycombinator.com/item?id=16695064
I use componentWillReceiveProps for just about everything - I had thought it was a fundamental part of the Redux flow. i.e. Redux updates, new props flow through the hierarchy, I pick that up in componentWillReceiveProps and make changes based on new props.
Is this not correct?
What you're describing sounds more like you're updating something external (e.g. your Redux store). This isn't what the lifecycle is meant for, and you'd be better off using componentDidUpdate instead.