I'm working on a website using React. I'm getting this error when using useContext() and useLocation().
import React, { useContext } from "react";
import Layout from "../components/Layout";
import { LangStateContext } from "../context/LangContext";
import { useLocation } from 'react-router';
const PricingPage = () => {
const { isIndoSelected } = useContext(LangStateContext);
console.log(isIndoSelected);
const location = useLocation();
return (
<Layout>
a page
</Layout>
);
};
export default PricingPage;
This is the error im getting when i land on the page
Can anyone explain to me why this wont work and what a good workaround would be?
Thanks you