Hi Richard, I'm not sure what you mean. What I do in this example is the same as fetching the user in a useEffect hook:
useDidMount is just a custom hook that uses the useEffect hook. And because it uses the useEffect hook with no dependencies it can ensure that the callback is only executed ones i.e. after mount.
So, also in this example you would probably handle the mount case with a conditional for your component rendering.
Hi Richard, I'm not sure what you mean. What I do in this example is the same as fetching the user in a useEffect hook:
So, also in this example you would probably handle the mount case with a conditional for your component rendering.
Ah, I see, then I just misunderstood useDidMount, thanks for the answer!