-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server-side rendering / client-side rendering out of sync #59
Comments
Hi @svdoever , If you've added onseen-ui during the development server's running process and just reloaded the page, its normal because the part that you've added did not exist on the initial render which is being done on the server side. However, styles should appear properly. Do you see these warnings after you restart the app? (or when you build the app for production). Quick note: We suggest importing the core parts of external ui-libraries like onseen-ui as a seperate vendor file instead of requiring them both on the client and server's entry files. To achieve this, you can create a vendor folder in the src directory and main.ts file inside it. Then, add that vendor/main.ts file into the webpack configuration (dev and prod) as an entry point. Actually, we've already prepared this file here: https://github.com/barbar/vortigern/blob/master/src/vendor/main.ts and set the related webpack configs. |
@svdoever any updates on this? |
excuse me, thought I already replied... yes is solved!! Thanks! |
I'm getting the following error:
It is clear that what is rendered at server side is not equal to what was rendered at client side.
What I did was including an existing ReactJS component library called react-onsenui (see https://onsen.io/v2/react.html).
I added to both the
client.tsx
file and theserver.tsx
file the following lines:and in the
Home.tsx
container I did:What do I need to do to keep client and server rendering in sync?
The text was updated successfully, but these errors were encountered: