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
Due to my app is create by CRA, so the index.html has no content inside it, react will render components after the browser load it. So I want prerendering the index.html for better user experience.
I'm following this tutorial, and then get a entry_server.tsx like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Due to my app is create by CRA, so the index.html has no content inside it, react will render components after the browser load it. So I want prerendering the index.html for better user experience.
I'm following this tutorial, and then get a entry_server.tsx like this:
Then I call the following commands to render this page:
but I get some errors:
I try add
'use client'
for my page, but it does not work. And this script will throw error when there is a<Outlet/>
inside__root.tsx
.here is my __root.tsx:
and the index.tsx:
How can I solve this?
Beta Was this translation helpful? Give feedback.
All reactions