Since react 18, using useEffect for data fetching should no more be an option (since now there is no guaranty it will not be called more than once).
Instead i highly suggest anyone to not reinvent the wheel and use an external data fetching hook library (react-query, swr, redux-toolkit rtk-query, @zodios/react, etc)
Since react 18, using useEffect for data fetching should no more be an option (since now there is no guaranty it will not be called more than once).
Instead i highly suggest anyone to not reinvent the wheel and use an external data fetching hook library (react-query, swr, redux-toolkit rtk-query, @zodios/react, etc)
LOL, may be you should revisit some of the docs:
beta.reactjs.org/learn/synchronizi...
reactjs.org/docs/faq-ajax.html