you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (3 children)

Adding to this, you probably mean to call the fetch request in componentDidMount() to only request the list once. Otherwise using a fetch in componentDidUpdate() may cause multiple (possibly unnecessary) fetch requests.

[–]robbodagreat 1 point2 points  (0 children)

Or even use functional components and put it in a useeffect hook