简体   繁体   中英

React.js require Node.js

Does React require Node.js ? If yes,then how and whats benefit and what is the main scenario, where we can avoid node.js?

React.js is a javascript library to provide component-based front-end development on your browsers. On the other hand, node.js is a javascript runtime based on Google's V8 engine, also known as Chrome's javascript engine. Using Node.js, you can build your own server.

I assume your question arose because you came up with a node.js development server for a react.js application. Any web application needs a server to respond client's requests with appropriate assets. The assets could be HTML, CSS, JS, and any media that would be utilized on your web app. In other words, when you built a React.js application and publish your app, you need a server to ship your app to users' browsers. That is where Node.js can play a role. However, it doesn't necessarily mean that you are required Node.js. Rather than utilizing Node.js, you can use Python, Java, or PHP to ship your React.js-powered applications to the web.

If your question means you just don't want to set up any server-side or backend stuff, what you can consider is to use Amazon's S3 bucket or Google's Firebase. You can just upload your front-end assets (HTML, CSS, and JS) to there, and they will create a backend automatically.

Hope this answered your question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM