This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note, doesn't deal with timeouts, infinite recursion, errors etc.. | |
async function resolveAll(render, promiseTracker) { | |
const renderResult = render(promiseTracker) | |
if (promiseTracker.hasWork) { | |
await promiseTracker.waitForCompletion() | |
return resolveAll(render, promiseTracker) | |
} | |
return renderResult | |
} | |
// And finally we can use it: | |
resolveAll(() => ReactDOM.renderToString(<App />), new PromiseTracker()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment