1
簡單的問題在這裏:流星與React如何將參數傳遞給.jsx。我想發送:令牌參數給我的jsx,所以我可以在表單提交後使用它。流星/反應/流量路由器/將參數傳遞給JSX
我使用kadira的flow-router和react-layout包
路線
FlowRouter.route('/reset/:token',{
name: 'reset',
action: function(params){
ReactLayout.render(App, {
content: <Reset token={params.token} />
})
}
})
Reset.jsx
Reset = React.createClass({
resetPass(e){
e.preventDefault();
alert("test");
},
render() {
return (
<form onSubmit={this.resetPass}>
<input type="password" id="password"/>
<input type="password" id="confirmation"/><br /><br />
<input type="submit" id="reset-button" value="Reset password" />
</form>
);
}
})