-
I am using react query select to transform my data into required form. But it is causing infinite loop TestComponent: useEffect(() => { useFetchHook: export const useFetchHook = () => { |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
inline select functions run on every render. you can extract or memoize them if you want. see: https://tkdodo.eu/blog/react-query-data-transformations#3-using-the-select-option also, you don't need a useEffect to derive state - that is very likely an antipattern. see: |
Beta Was this translation helpful? Give feedback.
inline select functions run on every render. you can extract or memoize them if you want. see:
https://tkdodo.eu/blog/react-query-data-transformations#3-using-the-select-option
also, you don't need a useEffect to derive state - that is very likely an antipattern. see:
https://tkdodo.eu/blog/dont-over-use-state