Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

RescriptRelay Query.use requires suspense wrapper

$
0
0

I was following RescriptRelay docs but ended up in a situation when I used Query.use on a component that is mounted after the initial render (for example when I push a new route and render a new component with a Query.use) whole page breaks and throws an error:

Error: A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.

I managed to fix it by wrapping an action that leads to rendering a new component with useTransition’s startTransition method (for example by wrapping all RescriptReactRouter.push calls), but it seems a little odd.
Is that supposed to work that way?


Viewing all articles
Browse latest Browse all 2592

Trending Articles