3 ms·
I think the problem is that React is developed as more of a Node/JavaScript project than as a web project. You see this in stuff like depending on `process`, a
by Touche 10y ago
I think the problem is that React is developed as more of a Node/JavaScript project than as a web project. You see this in stuff like depending on `process`, a thing that exists in Node but not on the Web. So the Web is a compilation target; not the platform that React is developed for.
From there it's easy to think about everything in terms of JavaScript, and not making the Web the intended target for usage.
- enraged_camel 10y agoYeah, along these lines, I also hate how most of the examples/tutorials online assume your server is Node.js. I'd love to find some official documentation on the best ways to use it with Asp.net and Rails, for example.
- pests 10y agoThat's usually because those tutorials are also setting up sever side rendering. Node.js is only needed for that and for running the various (optional) build tools. When doing a SPA I often set up Node.js to serve the index and provide server-side rendering and then never touch it again. Any actual API/WebSockets/RPC interfaces the app needs can be serviced by any plain old Ruby, Python, PHP, etc app backend. Since I usually use PHP from old habits, I use a Symfony API-only application. I posted about this in a top level comment, but don't forget React can control any element in your DOM and not just the entire body like most SPA's are setup. You can continue using whatever languages/frameworks templating and view systems and augment views as needed that would be better handled by React.