In principle, conservative use of derived state. Scenarios where derived state is used 1. Directly copy prop to state, or the computed value of a prop to state. (2) Don't copy the props value into state. Instead, implement a controlled component and merge the two values in the parent component. If the component itself stores temporary state: When the component is instantiated, the value of props is copied to state as the default value, and the modification of state has nothing to do with the props. If you want to change the props.ID, you need to reset the state of the props. If there is no proper ID, you can use a random key or an increment key (recommended). Resets an uncontrolled component with the ID of a prop. In static getDerivedStateFromProps, reset state based on changes in props.ID (cumbersome but useful) Option 2: Reset an uncontrolled component using the instance method, which can be called by the parent component using ref. Use memoize-one just to memoize the results of computations based on the current propsCopy the code