title: Using Brython with React
body: <p>I’ve just started using Brython, and am able to receive input from the page and run it through a series of python functions to return a value - but I’m unsure of the correct way to pass these values into a react component. I know nothing about react, and somebody else is doing the react/front side of the website. </p>
  
  <p>The reason we are trying to integrate Brython is because there are a lot of algorithms for manipulating the data that are far easier to write in python, and far quicker to execute in the browser each time the data must be manipulated. </p>
  
  <p>I’m aware of things such as flask and jsonify, but I’m unsure how to use them in this context. I’ve attached a symbolic snippet of Brython code running in browser for reference.</p>
  
  <pre><code>&lt;script type=“text/python” id=“script0”&gt;
  
    from browser import document
    from other_python_functions import func1
  
    def return_altered_input(e):
  
      altered_input = func1(e.target.value)
      document[‘output’].textContent = altered_input
  
    document[‘input_area’].bind(‘input’, return_altered_input)
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Currently it outputs to the document by referencing the id directly. Could I just put an id on the react element and send the output there somehow? Would I need to jsonify it first?</p>