Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import validator from './validator';
- class Example {
- constructor(props) {
- super(props)
- this.saveAndContinue = thos.saveAndContinue.bind(this)
- }
- saveAndContinue () {
- var valid = validator.validate(this.props.form)
- if (valid) {
- axios.post('/path')
- <Redirect to='/other_tab'>
- } else {
- validator.showErrors()
- }
- }
- render() {
- <button onClick={this.saveAndContinue}>Save and Continue</button>
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement