useRef in in preact-render-to-string #3587
-
I'm using @developit's prerender.js from I would like to use suspense-style data fetching in my components by throwing a promise. This works fine, and the components get re-rendered once the promise is resolved. What does not work is to use The only workaround I found is to keep track of the promises outside the components, which feels super hacky. Can you think of a better way to implement this? Would it be possible to make useRef/useMemo work in RTS? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is the same in React though, hooks get reset between suspensions as it's the only way to safely handle WIP states, discarding them. What we did in |
Beta Was this translation helpful? Give feedback.
This is the same in React though, hooks get reset between suspensions as it's the only way to safely handle WIP states, discarding them. What we did in
urql
was create an append-only cache to store the promise-->result transition.