-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Conversation
} | ||
} | ||
const FormSpecifyingValidationRulesExample = (props) => ( | ||
<Form className='segment' fields={fields} onSuccess={() => false}> |
There was a problem hiding this comment.
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.', | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deprecated settings prop.
There was a problem hiding this comment.
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, | ||
} |
There was a problem hiding this comment.
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.
See comment on practicalities and 🎸 |
Support Form settings and callback props
Fixes Form props are not passed to settings (prevent submit) #160, handling form plugin props.
Adds deprecate utility to warn users of upcoming deprecations: