Injecting callback for updating values in Stepper

This commit is contained in:
apanizo 2018-10-02 17:08:57 +02:00
parent c0a6c222dd
commit f31976df87
1 changed files with 5 additions and 1 deletions

View File

@ -69,7 +69,11 @@ class GnoStepper extends React.PureComponent<Props, State> {
const activePageProps = this.getPageProps(pages)
const { children, ...props } = activePageProps
return children(props)
return children({ ...props, updateInitialProps: this.updateInitialProps })
}
updateInitialProps = (initialValues) => {
this.setState({ values: initialValues })
}
validate = (values: Object) => {