Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Form settings and callback props #165

Merged
merged 11 commits into from
Feb 11, 2016
Merged

Conversation

levithomason
Copy link
Member

  1. Fixes Form props are not passed to settings (prevent submit) #160, handling form plugin props.

  2. Adds deprecate utility to warn users of upcoming deprecations:

    constructor(props, context) {
      super(props, context)
      deprecate.props(this, {
        settings: 'Use a separate prop for each setting.',
      })
    }

    image

}
}
const FormSpecifyingValidationRulesExample = (props) => (
<Form className='segment' fields={fields} onSuccess={() => false}>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use function form example component. Pulls deprecated form settings prop into individual props (fields, onSuccess).

deprecate.props(this, {
settings: 'Use a separate prop for each setting.',
})
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated settings prop.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff

onSuccess: PropTypes.func,
onFailure: PropTypes.func,
fields: PropTypes.object,
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the pattern we are using for separating plugin props from component props. There is a utility to pick this.props for only plugin props, useful when calling refresh on the plugin. There's also a util for omitting plugin props, useful when spreading user props or doing other component prop checks.

@ghost
Copy link

ghost commented Feb 9, 2016

See comment on practicalities and 🎸

levithomason added a commit that referenced this pull request Feb 11, 2016
Support Form settings and callback props
@levithomason levithomason merged commit 9abdc1b into master Feb 11, 2016
@levithomason levithomason deleted the feature/form-settings branch February 11, 2016 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant