constructor: Function components don’t need a constructor. You can initialize the state in the
useStatecall. If computing the initial state is expensive, you can pass a function to
getDerivedStateFromProps: Schedule an update while rendering instead.
render: This is the function component body itself.
useEffectHook can express all combinations of these (including less common cases).
getDerivedStateFromError: There are no Hook equivalents for these methods yet, but they will be added soon.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.