Skip to content

SSR with Inetia JS #5272

Answered by jobyh
zumbidoweb asked this question in General
Sep 16, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

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 to createInertiaApp in the SSR entrypoint file e.g. resources/js/ssr.tsx

SSR Entrypoint

// resources/js/ssr.tsx

import Layout from './Pages/Layout'
import ReactDOMServer, { renderToString } from 'react-dom/server'
import { getSe…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Haroenv
Comment options

@jobyh
Comment options

Answer selected by Haroenv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Library: React InstantSearch < 7 Issues in any of the react-instantsearch@6 packages
4 participants