You have to reset some state when a prop changes using the getDerivedStateFromProps(). However, you observe that this make your code verbose.
Which of these steps should you take to avoid this?
- Make the component fully controlled or fully uncontrolled with a key
- Use componentDidUpdate lifecycle
- Use a memoization helper
- Make the child components to re-render