You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So basically you do a two pass render, JavaScript will explain it better
than English so here’s the gist of it:
```jsx
const context = createServerRenderContext()
let html = renderToString(<ServerRouter context={context}/>)
const result = context.getResult()
if (result.missed) {
// do it again
html = renderToString(<ServerRouter context={context}/>)
}
res.send(result.missed ? 404 : 200, html)
```
Hopefully one day we’ll have `componentDidServerRender` and we’ll be
able to clean this up a bit.
0 commit comments