|
|
|
|
|
by flowerlad
1730 days ago
|
|
That works well... until you have stateful components and you want to send in new props. At that point the recommended approach is to replace the entire component by using the key property. For simple components, especially stateless ones, React works well. When the component needs to manage user interactions it needs state, and then if you need to update props you have to make a new instance of the component, and that point React has failed in its promise. |
|
Where did you hear that? React.Component has both props and state and both seem to work pretty well together, and you definitely don't need to destroy the component by changing the key property just because props changed.