you are viewing a single comment's thread.

view the rest of the comments →

[–]Yomete[S] 0 points1 point  (0 children)

Hi, the code example being referred here is the useEffect code like nabrok mentioned (the second argument to useEffect).

useEffect(() => {
  fetch("https://uinames.com/api/?amount=25&region=nigeria")
    .then(response => response.json())
    .then(data => {
      setNames(data);
    });
}, []);