I read How to sync props to state using React hooks : setState() that is basically about how to mimic getDerivedStateFromProps in a functional component. The accepted answer said to use useEffect. But the problem is that this would cause an extra unnecessary render, as some comments pointed out. So I wanted to ask a separate question about specifically whether useEffect should be used in this case.