why HTML node showing empty or undefined?
naveennsit opened this issue · 1 comments
naveennsit commented
I am checking this code to render react component on SSR
https://github.com/htdangkhoa/react-ssr-starter.
deployed latest code https://reactssrstarter.herokuapp.com/home
When I check source code HTML is not generated or In other words react component is not rendered on server
I try to debug issue below node
coming undefined
don't know why ?
const node = await ssrPrepass(
<ChunkExtractorManager extractor={extractor}>
<Provider store={store}>
<StaticRouter location={req.url}>
<HelmetProvider context={helmetContext}>
<App />
</HelmetProvider>
</StaticRouter>
</Provider>
</ChunkExtractorManager>,
);
const markup = renderToString(node);
any idea ? ?
kitten commented
Please check the types and docs ✌️
Prepass does not return React elements and hence your const node
variable is being set to undefined
:
react-ssr-prepass/src/index.js
Line 61 in 0991197