3
I'm trying to pass flask variables from the server to react but I can't get it working. At the moment I have a render function in a reactjs file that looks like:
ReactDOM.render(
  <Attribute prop1='{{ prop1 }}' prop2='{{ prop2 }}' />,
  document.getElementById('main')
);

In python on the flask server I have:

return render_template('index.html', prop1=var1, prop2=var2)

1 Answer 1

0

It should be

  <Attribute prop1={ prop1 } prop2={ prop2 } />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.