|
|
|
|
|
by danabramov
3009 days ago
|
|
Note: createRef doesn’t replace callback refs. It just offers a more ergonomic API for common use cases. There are still rarer cases where callback refs are useful. For example when you need to run a side effect on a node as it attaches and detaches. Also note: legacy lifecycles are not deprecated yet. You won’t see the warnings unless you opt in with <StrictMode>. They will be officially deprecated in a future minor release when more libraries have had time to update. |
|
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?