Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react'
- //You may ask why do i use custom validation, if redux-form has its own?
- //Because i can.
- export default (Component) => class Validate extends React.Component {
- constructor() {
- super()
- this.state = {
- isValidated: false,
- }
- }
- render() {
- return <Component {...this.props} {...this.state} validateForm={this.validateForm}
- isValidated={this.state.validated}/>
- }
- validateForm = () => {
- console.log('I WAS CLICKED---------------------------', this.state)
- //validate like a boss
- this.setState({
- isValidated: true
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement