6 ms·
I'm not sure what you mean, could you clarify? Having a stateful component render something different based on a prop change is core to react. Using the key pro
by econnors 5y ago
I'm not sure what you mean, could you clarify? Having a stateful component render something different based on a prop change is core to react. Using the key property "resets" the component by rendering a new one, but just because you use state doesn't mean you can't change props.
- flowerlad 5y agoIt is recommended by FB: https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#recommendation-fully-uncontrolled-component-with-a-key https://reactjs.org/blog/2018/06/07/you-probably-dont-need-d...