title: react frontend connecting to flask backend Howto
body: <p>I have a ReactJS front end and a flask backend and I am having difficulties making both talk to each other, particular sending form variables from the frontend to Flask. </p>
  
  <p>Given below is my front end code which runs on 127.0.0.1:3000</p>
  
  <pre><code>import ReactDOM from 'react-dom';
  import React, { Component } from 'react';
  class Form1 extends Component{
    render(){
      return(
          &lt;div class="form"&gt;
              &lt;form action="/result" method="get"&gt;
                  &lt;input type="text" name="place" /&gt;
                  &lt;input type="submit" /&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      );
    }
  }
  ReactDOM.render(
  &lt;Form1/&gt;,
  document.getElementById('root')
  );
  </code></pre>
  
  <p>My backend flask code is as given below and runs on 127.0.0.1:5000</p>
  
  <pre><code>from flask import Flask, render_template, request
  import requests
  import json
  app = Flask(__name__)
  @app.route('/result',methods = ['POST', 'GET'])
  def result():
     if request.method == 'GET':
        result = request.form
        print (result['place'])
  </code></pre>