I am parsing HTML string to react component.
when I reload the page then first time response came from server and page render perfectly.
Now client side rendering start working and page become blank(flicker) for 1 sec. then again page rerender.
my HTML string size is around 300kb.
How I can overcome this flickering page between SSR and CSR?
For creating HTML string to Component page I am using following NPM package
-
react-shadow
-
react-html-parser
-
htmlparser2
<root.div className='htmlTemplate' mode={elem ? 'open' : 'closed'} > <style>{globalCss}</style> <div ref={this.setRef} className={className} {...rest}> {ReactHtmlParser(templateParser(template, templateData), { decodeEntities: decodeTemplate, transform: this.transform })} </div> </root.div>
Server side I am using ReactDOM.renderToNodeStream