As the title said.
I have a stateless component based on react-bootstrap-typeahead
and a form wizard based on the formik multi-step wizard example found in the docs.
However, I am unable to pass the values I got from the typeahead
component into formik
. I can't access setFieldValue
.
const FormElements = setFieldValue => (
<Wizard
initialValues={FORM_VALUES}
onSubmit={(values, actions) => {
sleep(300).then(() => {
window.alert(JSON.stringify(values, null, 2));
actions.setSubmitting(false);
});
}}
>
<Wizard.Page>
<GoogleMapsPlaceLookup
value={location => {
console.log("I got the value correctly from my child: ", location);
}}
/>
</Wizard.Page>
</Wizard>
);
export default FormElements;
How do I inject this value into Formik
, so it can be processed onSubmit
. Any pointer or help will be appreciated.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…