From f31976df872b2ef7c2e4cfba103d8584d6c9e0c7 Mon Sep 17 00:00:00 2001 From: apanizo Date: Tue, 2 Oct 2018 17:08:57 +0200 Subject: [PATCH] Injecting callback for updating values in Stepper --- src/components/Stepper/index.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Stepper/index.jsx b/src/components/Stepper/index.jsx index 5cc89ef6..80634988 100644 --- a/src/components/Stepper/index.jsx +++ b/src/components/Stepper/index.jsx @@ -69,7 +69,11 @@ class GnoStepper extends React.PureComponent { 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) => {