7

In an article I read that

React uses server-side rendering.

But in another articles I came across this:

Client-Side-Rendering is a relatively new approach to rendering websites, and it didn't really become popular until JavaScript libraries started incorporating it into their style of development. Some notable examples are Vue.js and React.js

Now Which statement is correct?

When I use create-react-app and run npm start, it seems to me that React uses the Client-Side-Rendering. isn't it?

5
  • 2
    Yes, you're right in that CRA uses client-side rendering. React can also be server rendered. E.g. Razzle uses both server-side rendering and client-side rendering. Commented Mar 16, 2019 at 19:21
  • Making statements from unverified sources without even linking them doesn't make sense. You clearly took quotes out of context. Does React use server-side-rendering or client-side-rendering? - both. Commented Mar 16, 2019 at 19:25
  • 3
    @estus nobody is trying to misrepresent anything on purpose. It's a legitimate question. Commented Mar 16, 2019 at 19:38
  • @Marquizzo I'm not accusing nobody. Yet the question could be asked in more constructive way. In this form it's prone to speculations. I'm positive an article didn't really state that React uses only server-side rendering. Commented Mar 16, 2019 at 19:52
  • Does this answer your question? ReactJS server-side rendering vs client-side rendering Commented Jun 1, 2021 at 18:24

4 Answers 4

8

It’s client side. But React, like some other client side libraries, can be used on the server to prerender it with node, usually for SEO.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. But what happens on a server like Heroku or Netlify? Are they using a node server or similar technic to render the react app on the server?
@user1941537 You can set up a server-rendered React app on Heroku, which will run in Node.js like you say. Netlify is more geared toward static assets, so you either just serve a SPA that is client-side rendered or a pre-rendered app with e.g. Gatsby.
5

Out of the box it renders on the client side.

But, if you have a requirement to render pages on a server, you can achieve this with:

Next.js or Hypernova or any other tool (there is a bunch of them nowadays!)

Note, that SSR will require a bit more experience than a regular React app.

The main goal of this approach is to allow search engine robots crawl information form web pages(SEO).

Comments

2

create-react-app uses client side rendering by default. There are some tools like next js and gatsby js which pre-render pages on the server side. You can also do Server Side Rendering from scratch.

Comments

2

A few years on from the last answer, it is now quite difficult to implement a client-only React app - serving it on Node is trivial and absolutely what it expects, trying to use it as a client library with other server-side support is more of a challenge and documentation about how to do this is patchy and much of it out of date.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.