Cannot reuse useFetch
15:03 09 Mar 2026

I am currently building a small project where I want to perform api calls to a public api. I am using react(19.2.0) with typescript. I can display the items from the jsonplaceholder api, however when I am trying to fetch a single item, the useEffect does not run. I wrote a custom useFetch hook and reused it twice.

useFetch code

users.tsx

UserInfoComponent

App.tsx

enter image description here

reactjs rest react-hooks