I'm getting started on this React thing. From what I'm seeing there is no other way to use React other than writing it in JSX and then compiling it with Babel to make it work. But to be able to use Babel from the console I have to use Node.js. If not, the only one I have left is to use Babel from the web , but clearly this method is not practical at all. I'm using Django for the server side, so I don't want to have to start implementing server-side code in Node. Just use it for the frontend
. Is there any way to do it?
To use JSX, it is necessary to use a Transpiler like Babel , the best solution to not using Node would be to use babel-standalone via the CDN . Make your scripts separately and upload them. babel-standalone gives you the tools to compile it online.
If you don't want to use the CDN , you could create a small Node installation on your local machine, use Webpack or babel-cli to compile the JSX and upload it to your server.
Here you can find more information about babel-standalone .
If you want to avoid the configuration with babel and web pack and start as quickly as possible with the front end, I recommend you
react-create-app
the cli recommended by the facebook team to start your front end without messing with node, babel and webpack, everything is already configured for that you start programming with react.This application should communicate with your back through
Django
the service making http requests from front to back to get the information you need.react-create-app
It has a command to build your projectnpm run build
and you can easily upload it to your host like heroku aws etc.