Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why we have to install NodeJS for ReactJS

I'm a beginner in ReactJS also for NodeJS. I would love to know why we have to install NodeJS run ReactJS application as ReactJS is client-side scripting.

like image 213
yudi Avatar asked Jul 15 '26 04:07

yudi


1 Answers

The other answer is incorrect. You don't NEED Node.js, in fact you could create a project without running a single npm command. Just follow this guide.

The main reason, as pointed out in the article, is:

  1. Easy package management. This means you can upgrade the package easily later on
  2. JSX is the templating language that makes it way easier to write components: <h1>Hello Word</h1> reads so much better than React.createElement('h1', null, 'Hello World')
  3. Managing module imports, as opposed to having global variables around everywhere, it's great to have encapsulation and import modules as needed.
  4. Build step and workflow. For a modern project, you will need tools to minify your code, cache busting, transpiling (writing pure javascript for old browser is a pain and you really shouldn't do it manually), the list goes on and on.
like image 55
Jonny Lin Avatar answered Jul 19 '26 07:07

Jonny Lin