Building webViews with React

First of all, we will create a home view from which React will be called. So, let's create index.html, which has the following contents, in the template directory:

    <!DOCTYPE html> 
    <html> 
     <head lang="en"> 
      <meta charset="UTF-8"> 
      <title>Flask react</title> 
    </head> 
   <body> 
     <div class="container"> 
       <h1></h1> 
       <br> 
       <div id="react"></div> 
 
    </div> 
 
   <!-- scripts --> 
    <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/      react/15.1.0/react.min.js"></script> 
    <script src="https://npmcdn.com/react-      router@2.8.1/umd/ReactRouter.min.js"></script> 
    <script src="https://cdnjs.cloudflare.com/ajax/ libs/react/15.1.0/react-dom.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/ ...

Get Cloud Native Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.