Describe the bug
We need to prevent a query from re-rendering. We are setting query options { enabled: false, notifyOnChangedProps: [] } once the query is fetched. We mutate the same data in another component. Despite the options being set, the query still re-renders.
Your minimal, reproducible example
https://codesandbox.io/s/react-query-forked-8gly22?file=/src/App.tsx
Steps to reproduce
- Open codesandbox console.
- Type something into the input and press Mutate todo button.
- See console output, no log should occur as the component should not re-render.
Expected behavior
Query with options.notifyOnChangedProps set to an empty array does not re-render.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Safari 15.6, Chrome 104
react-query version
v4.1.3
TypeScript version
v4.7.4
Additional context
No response