Preclinify / Tickets

2 stars 0 forks source link

[BUG] Launching Endless fires the question load twice #42

Closed Joecey closed 6 months ago

Joecey commented 6 months ago

Describe the bug

When loading into endless questions for the first time, it "loads" twice before settling. This is more of a visual bug, but it is very odd for thee user.

Note for dev

This is caused by React.StrictMode and useEffect being used. Usually in production, this shouldn't happen but I suggest integrating a package like SWR or Tanstack react-query to deal with calls like this. A fun article explaining this here: https://tkdodo.eu/blog/why-you-want-react-query

Joecey commented 6 months ago

Just kidding this shit wasn't a visual bug i'm just silly. I'll probably throw in tanstack or RQ since this is client side data fetching