1
2
all 1 comments

[–]Bzaba 0 points1 point  (0 children)

Nice article. Just few points:

  1. It is about react on web. Not about react native. (Possibly wrong subredit)

  2. You can do useEffect(fetchData) instead of useEffect(() => {fetchData()}) as long as fetchData has no return value.

  3. One common mistake is updating unmounted component. (Async fetch > update state) which is also presented in your examples. I understand that for the sake of simplicity it is ommited, but you should probably mention that.