SSR with Inetia JS #5272
Answered
by
jobyh
zumbidoweb
asked this question in
General
SSR with Inetia JS
#5272
-
Trying to get the inerita ssr.js to render the initial state for React instant search and send it as props, as decribe here for Next and Express server. But I can not replicate it to inertia. |
Beta Was this translation helpful? Give feedback.
Answered by
jobyh
Apr 19, 2024
Replies: 2 comments 2 replies
-
Inertia does not have a node backend right? I'm not sure how it could be implemented. If you have an application that shows the setup clearly but doesn't yet have server side rendering working, we can have a look |
Beta Was this translation helpful? Give feedback.
0 replies
-
Any update on this ? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @Haroenv @zumbidoweb & @devidimitrov I was facing the same issue and now have this working. Just posting for any others who end up here. 🙂 RE: Node backend, yes Inertia does achieve SSR using a Node backend.
I’m using Laravel with React / TypeScript powered by Inertia so if you’re using Vue or Svelte you’ll need to adapt the examples but the principle should be the same.
The initial state render needs to be done in the
setup
method of the options object passed tocreateInertiaApp
in the SSR entrypoint file e.g.resources/js/ssr.tsx
SSR Entrypoint