Great question — answering as the UphillTech team:
Really there's nothing overtly incorrect or wrong about this code, using a useEffect hook with empty dependency array to run an effect exactly once to fetch data asynchronously and save to local state is a long-standing and accepted convention. Issue React 19 introduced stricter lint rules. Basically the issue here is that because fetchInboundRequests is declared outside the effect the static code analysis React-Hooks linter uses can't guarantee that no execution paths inside fetchInboundRequests won't synchronously trigger state updates during the initial render. Solution Suggestions Move fetcher into hook body Trivial solution is to move fetchInboundRequests into the effect so (a) it's...
Full answer by Drew Reese: https://stackoverflow.stackexchange.com/a/80005872 (CC BY-SA 4.0).
Need it done for your business? UphillTech.