title: How to use React and material-ui with flask backend?
body: <p>I am a beginner with react. I was just trying to make a web app with <strong>flask</strong> backend and <strong>react</strong> frontend with <strong>material-ui</strong> but I was facing problems with setting it up.</p>
  
  <p><strong>What I did</strong></p>
  
  <p>I downloaded the React Scripts from <a href="https://reactjs.org/docs/cdn-links.html" rel="nofollow noreferrer">here</a>. Then the material-ui from CDN links available <a href="https://material-ui.com/getting-started/installation/" rel="nofollow noreferrer">here</a> and babel from <a href="https://babeljs.io/setup#installation" rel="nofollow noreferrer">here</a>. I downloaded and self hosted them all as I am developing for a local network which needs to have offline support.</p>
  
  <p><strong>My code</strong></p>
  
  <p><em>index.html</em></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script src="/src/libs/babel.min.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="root"&gt;&lt;/div&gt;
      &lt;/body&gt;
      &lt;script src="/src/js/index.js" type="text/babel"&gt;&lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><em>index.js</em></p>
  
  <pre><code>import {React} from './src/libs/react.min.js';
  import {ReactDOM} from './src/libs/react-dom.min.js';
  import * as mui from './src/libs/material-ui.min.js';
  
  ReactDOM.render(&lt;mui.Switch /&gt;, document.getElementById('root'))
  </code></pre>
  
  <p>Its almost empty because I am just setting up things.</p>
  
  <p><strong>The error I am facing</strong></p>
  
  <pre><code>Uncaught ReferenceError: require is not defined
      at &lt;anonymous&gt;:5:17
      at VH (babel.min.js:1)
      at a (babel.min.js:1)
      at s (babel.min.js:1)
      at XMLHttpRequest.HH.t.forEach.e.src.o.onreadystatechange (babel.min.js:1)
  </code></pre>
  
  <p>Now I don't know how do I get this <em>require</em> thing working with a python backend. Is there any other way of solving this problem? It doesn't matter even if all of the code has to be changed as its just the setup and no actual code.</p>