The following change worked for me: Changing from const context = React.useContext(... to:
const context = React.useContext(...
import { useContext } from 'react'; ... const context = useContext(...