passing flask python variables on the server to reactjs as props -
i'm trying pass flask variables server react can't working. @ moment have render function in reactjs file looks like: reactdom.render( <attribute prop1='{{ prop1 }}' prop2='{{ prop2 }}' />, document.getelementbyid('main') );
in python on flask server have:
return render_template('index.html', prop1=var1, prop2=var2)
it should
<attribute prop1={ prop1 } prop2={ prop2 } />
Comments
Post a Comment