I'm using useFormikContext like in this example (I'm using NextJS), but the error I get is this "TypeError: Cannot read property 'submitForm' of undefined". The version of Formik I'm using is 2.1.5
This is some code of my component:
import React, { useEffect, useState, useContext } from 'react'
import { useFormikContext, Formik } from 'formik'
import './projects.css';
const ProjectForm = ({ project, ...rest }) => {
const classes = useStyles()
const [isSaved, setIsSaved] = useState()
const { submitForm } = useFormikContext()
.
.
.
}