July 2017
Beginner to intermediate
340 pages
7h 43m
English
People building React apps usually code their server-side parts in Node.js (https://nodejs.org/en/), because it is simpler to stick with a single language and use its ecosystem for all the tools that are used when working with an application.
However, serving React apps with Flask is not a problem at all. The HTML page can be rendered using Jinja2, and the transpiled JSX files serve as static files like you would do for JavaScript files. Moreover, as we have seen in the previous section, we can get the React distribution as JS files, and just add them into our Flask static directory alongside other files.
Our Flask app, let's name it dashboard, will start off with a simple structure like this:
Read now
Unlock full access