Consider the following code:
import React from 'react';
class TestForm extends React.Component {
constructor(props) {
super(props);
}
_submitTest(e) {
e.preventDefault();
this.context.router.transitionTo('/test-next-page', {param_test: 'Test Data'});
}
render() {
return (
<div className="post-content row">
<form className="test-form" method="post" onSubmit={this._submitTest.bind(this)}>
<input type="submit" value="Submit" className="btn btn-primary btn-lg"/>
</form>
</div>
);
}
}
TestForm.contextTypes = {
router: React.PropTypes.object
}
export default TestForm;
the this.context.router.transitionTo()
line in the _submitTest()
function send me to the test-next-page page/component but i am not seeing the param value in the component!
Am I doing anything wrong in the second parameter of this.context.router.transitionTo()?