ezequiel/react-typeahead-component

Server-Side Rendering

jpsfs opened this issue · 3 comments

jpsfs commented

Hi!

Thank you so much for typeahead component! It works really well!
I'm having a small issue with server-side rendering. I don't know if you ever tested this.

image

From what I've gathered, when document exists you inject some css. This generates an issue with server-side rendering, because the rendered DOM on the server is different from the one rendered on the browser, giving the nasty error above.

Can you consider embedding the CSS into the JSX or providing it as a separated file to be included with less or into the head ?

Cheers!

@jpsfs Thanks for the feedback. Very interesting! I have not considered this use case. I figured appending styles to the head was the most convenient option to the developer.

I will go ahead with inlining the styles, as the defaults currently provided should probably never be overriden anyway.

@jpsfs I've published the changes in react-typeahead-component@0.4.0. Can you see if the issue is fixed? Thanks again. 🚀

jpsfs commented

Hi @ezequiel ,

Uau, that was a lightening speed release. This issue is now fixed!
Thank you again for the great component!

Best regards,