Server Side Rendering React + Vite - Explaining the Concept

Published: 17 September 2024
on channel: Computer Science For Everyone
15,446
302

Update: This is a good video to teach you the concept of a React SSR app with Vite, Express.js, and React Router. However things move fast in the JavaScript world, as of July of 2025, if you want to develop a React SSR app with Vite, then the simplest way to go is with React Router v7, the video tutorial and GitHub repo are here:    • Mastering React Router v7 Server Side Render  

00:00 Introduction
2:26 Vite Server-Side Rendering Documentations
3:11 Vite React SSR app we're building
3:52 Vite SSR CLI
6:02 What the CLI generated for us
6:12 Starter project on Github
7:31 SSR specific files generated by CLI
8:12 Intro to package.json file
9:44 Why we use ExpressJS library
11:24 entry-client.tsx file
14:15 entry-server.tsx file
16:05 server.js file
17:40 Purpose of ssr Manifest
19:16 Project directory structure / Basic React setup
21:47 React Router version 6 setup
25:00 Import BrowserRouter in entry-client.tsx
25:40 Import StaticRouter in entry-server.tsx
27:34 Running the app for the first time
28:25 Run npm build
29:08 Optional (Common errors with SSR apps)
30:46 Optional (How to fix common server side rendering errors)
33:08 Closing statement

How to setup server side rendering with Vite and React, using TypeScript.

Github Repo Starter Project: https://github.com/hoosierhugh/vite-r...

This app is deployed on Vercel here: https://vite-react-server-side-render...

If you would like to learn how to fetch data in a Vite/React SSR app using Vike, I created a repo for this here: https://github.com/hoosierhugh/vite-r...
And a companion video:    • How To Safely Fetch Data with Vike in Reac...  

Github Repo Finished Project: https://github.com/hoosierhugh/vite-r...
If you would like to contribute to my coffee fund: https://www.paypal.com/donate/?busine...

If you would like to create your own Vite/React/SSR with NodeJS and Express.js 5, I've created an example project for you here: https://github.com/hoosierhuy/vite-re...

Vite SSR Docs: https://vitejs.dev/guide/ssr


On this page of the site you can watch the video online Server Side Rendering React + Vite - Explaining the Concept with a duration of hours minute second in good quality, which was uploaded by the user Computer Science For Everyone 17 September 2024, share the link with friends and acquaintances, this video has already been watched 15,446 times on youtube and it was liked by 302 viewers. Enjoy your viewing!