How to submit React form when the submit button is above the form element
Formik forms are submitted via their own function `handleSubmit`. However if your submit button is in a parent component, how do you control the Formik handleSubmit property?
Solution
Using a reference:
```
const onClickApply = () => {
const formctx: any = formRef.current;
if (formctx) {
formctx.handleSubmit();
}
};
```
```
and below
```
const formRef = React.useRef();
Recent Comments