reactjs does not only run in node; it is a JavaScript library used to build user interfaces. In development mode, the Create react application runs NodeJs and Webpack development servers, but if it is not rendered on the server side, reactjs is just a front-end framework. It can be used with JavaScript, no node is required.
The operating environment of this article: Windows 10 system, nodejs version 16, Dell G3 computer.
No, it can run wherever js can run.
In development mode, yes. The Create react app runs a NodeJs and Webpack development server, allowing you to get feedback when you modify files and start or stop the server.
If you need to render on the server side, you will inevitably use node.
If not used, then it is a pure front-end framework.
Expand knowledge
During the web development process, if we need to reflect changing data to the UI in real time, we must operate on the DOM. The virtual DOM of reactjs makes page rendering very efficient and more controllable than directly manipulating the DOM.
1. What is reactjs?
It originated as an internal project at Facebook and was used to build the Instagram website, and was open sourced in May 2013;
It is one of the three mainstream frameworks of JavaScript libraries;
Is a JAVASCRIPT library for building user interfaces;
Mainly used to build UI, it can be regarded as the view layer and is an efficient view.
2. Two characteristics of reactjs:
Componentization: Building components through reactjs makes the code easier to reuse and can be well applied in the development of large projects.
Virtual DOM: It makes page rendering very efficient and more controllable than directly manipulating the DOM.
3. Advantages:
It has high performance and very simple code logic. More and more people have begun to pay attention to and use it.
The combination of reactjs's componentization and efficient virtual DOM gives reactjs powerful top-down page rendering capabilities.
In addition, React provides some novel concepts, libraries and programming principles, which allows us to write fast, compact and beautiful code on the server and client to build web applications~
what is nodejs?
First of all, it is important to understand that Node is not a web server. It doesn't do anything by itself. It doesn't work like Apache. If you want it to be an HTTP server, you have to write it yourself with the help of its built-in libraries. Node.js is just another way of executing code on your computer, it's a simple JavaScript Runtime.
Simply put, Node.js is JavaScript running on the server.
Node.js is a platform built on the Chrome JavaScript runtime.
Node.js is an event-driven I/O server-side JavaScript environment based on Google's V8 engine. The V8 engine executes Javascript very quickly and has very good performance.
Recommended learning: "nodejs video tutorial"
The above are the details of whether reactjs can only run in node. For more information, please pay attention to other related articles on this site!