-
Checkout this example. When clicking the button the component re-renders two times. The first render is because the context changed and the second because Background: In our app some URL query parameters are mapped to backend calls. In some cases we can prefill the query cache when changing the parameter. Each component that uses the hook is then rendered one additional time for each prefilled cache entry producing the same elements each time. It would be nice if this worked out of the box with one re-render. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I've converted your example to react-18 and our react-18 compatible preview build, and it seems to render correctly there: https://codesandbox.io/s/double-render-react-18-dnv07?file=/src/index.js I think this is loosely the same as this bug: where also calling |
Beta Was this translation helpful? Give feedback.
I've converted your example to react-18 and our react-18 compatible preview build, and it seems to render correctly there:
https://codesandbox.io/s/double-render-react-18-dnv07?file=/src/index.js
I think this is loosely the same as this bug:
where also calling
setQueryData
and setting some react-state causes inconsistencies.