how to pass a child component's validated data (as a formik form) to its parent component and handle form submission in parent

后端 未结 1 1195
灰色年华
灰色年华 2021-01-25 03:46

Is there a way to pass formik form values from a child component to a parent component and handle form submission in parent component only. I have a use case where I\'m building

1条回答
  •  别那么骄傲
    2021-01-25 04:11

    by using props you can achieve this.

    Screen 1:

    render(
     
               {
                  this.setState({formProps: formProps});
                }}
              />
              
            
    )
    

    Screen 2:

    if (onValueChange) {
         onValueChange(formProps);
     }
    

    0 讨论(0)
提交回复
热议问题