react-fetching-library
react-fetching-library copied to clipboard
expose promises for server side rendering
In order to use this library with server-side rendering techniques other than Nextjs, it needs a way to expose all the promises registered via useQuery
so the server-side can await all those promises to resolve before re-rendering the application.
Do you use any library for SSR? If so could you provide example in codesandbox? It will help me with finding a way to solve your problem 🙂
Not using one currently, I wanted to use react-fetching-library
library and add SSR support built into it. The approach would be similar to this library. https://github.com/simoneb/axios-hooks where it exposes all the promises registered that can be awaited upon.
@tmjam Does this not work for you?
const { query } = useQuery(action, false);
// elsewhere in your component in an async function:
const response = await query()