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')
);
在flask服务器上的python中,我有:
return render_template('index.html', prop1=var1, prop2=var2)