I define:
class Form1 extends React.Component{
....
}
and then define the HOC using withFormic:
const Form2 = withFormik({
handleSubmit(values, { resetForm, setErrors, setSubmitting }) {
...
},
....
})(Form1);
In the parent component, I specify a callback function:
<Task2 callback={this.something} />
Now, I want the handleSubmit to call the callback function. I would do just
this.props.callback()
but it seems that this is not defined in the HOC.
Question: how can I access the Form1.props within the HOC?