blitz-js / legacy-framework

MIT License
2 stars 2 forks source link

Suspense+usePaginatedQuery infinite loop re-rendering #167

Closed winner106 closed 2 years ago

winner106 commented 2 years ago

What is the problem?

Suspense + usePaginatedQuery infinite loop re-rendering

Paste all your error logs here:

console

Paste all relevant code snippets here:

code

What are detailed steps to reproduce this?

  1. usePaginatedQuery or useQuery to fetch data
  2. use Suspense wrap then component
  3. when type the address in the browser, will trigger infinite loop fetching data and re-rendering

Run blitz -v and paste the output here:

PS C:\Users\Administrator\Desktop\datasays> blitz -v
Loaded env from C:\Users\Administrator\Desktop\datasays\.env.local
Loaded env from C:\Users\Administrator\Desktop\datasays\.env
Windows 10 | win32-x64 | Node: v16.13.1

blitz: 0.45.0 (global)
blitz: 0.44.4 (local) 

  Package manager: yarn 
  System:
    OS: Windows 10 10.0.19043
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
    Memory: 15.21 GB / 23.87 GB
  Binaries:
    Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
    npm: 7.24.2 - ~\AppData\Local\Yarn\bin\npm.CMD
    Watchman: Not Found
  npmPackages:
    @prisma/client: 3.7.0 => 3.7.0 
    blitz: 0.44.4 => 0.44.4 
    prisma: 3.7.0 => 3.7.0 
    react: 18.0.0-beta-149b420f6-20211119 => 18.0.0-beta-149b420f6-20211119       
    react-dom: 18.0.0-alpha-5ca4b0433-20211020 => 18.0.0-alpha-5ca4b0433-20211020 
    typescript: ~4.5 => 4.5.4 

Please include below any other applicable logs and screenshots that show your problem:

No response

beerose commented 2 years ago

Hi, I just tried reproducing it with the same code, and it works fine for me. Maybe the problem is somewhere else outside of usePaginatedQuery + Suspense?