Does React require Node.js? If yes,then how and whats benefit and what is the main scenario, where we can avoid node.js?
-
Check this stackoverflow.com/questions/36256409/…Shubham Khatri– Shubham Khatri2018-01-04 06:07:02 +00:00Commented Jan 4, 2018 at 6:07
-
no it does not depend on node and doesnt require it. its a client side library and does not care about the serversideSujit.Warrier– Sujit.Warrier2018-01-04 06:19:46 +00:00Commented Jan 4, 2018 at 6:19
-
1Possible duplicate of Does using React.js limits us on using a node.js serverMika Sundland– Mika Sundland2018-01-04 11:12:29 +00:00Commented Jan 4, 2018 at 11:12
-
@MikaS Does using React.js limits us on using a node.js server Answer not satisfactory.Prabhu Nandan Kumar– Prabhu Nandan Kumar2018-01-04 17:37:46 +00:00Commented Jan 4, 2018 at 17:37
1 Answer
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.