Infinite query loading with React 18 Suspense and Reconciliation
AntoineDuComptoirDesPharmacies opened this issue Β· comments
π Current behavior
On a SPA where 'pageA' contains InstantSearch
node, pageB
is slow to load in lazy loading with Suspense.
If user switch fast from pageA
to pageB
and then go back to pageA
before pageB
loading ended, InstantSearch
state became broken with an infinite loading.
It may be linked to :
- React do not dismount/remount
InstantSearch
node as DOM reconciliation indicate that there is no change - Query response arrived while Suspense was in progress and so was not processed by InstantSearch node
π Steps to reproduce
- Go to codesandbox in Chrome Slow 3G mode
- Once red square disappear and you start reading "loading", click immediately on
pageB
link - When red square appear to go to
pageB
, immediately click onpageA
link - You arrive on
pageA
with infinite loading
Live reproduction
https://codesandbox.io/s/goofy-goldwasser-ixfg0z?file=/src/App.js
π Expected behavior
Either the query should be relaunched when arriving on pageA
or loading
should end with results from query.
Package version
react-instantsearch-dom: 6.32.0
Operating system
Windows 10
Browser
Chrome 110
Code of Conduct
- I agree to follow this project's Code of Conduct