在服务器上传递flask python变量,以反应为道具

时间:2017-09-10 09:53:28

标签: python reactjs flask

scanf

在烧瓶服务器的python中,我有:

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')
);

1 个答案:

答案 0 :(得分:0)

应该是

  <Attribute prop1={ prop1 } prop2={ prop2 } />