Now I'm building the application using React.js. All pages are working excepting of auth page. After logging successfully, it should bring the user to the home page but it was broken, and showed the blank page. After refreshing the manually, it started to show the home page.
When I checked the application thru development tools in the chrome browser, it says "Uncaught TypeError: destroy is not a function"
.
I attached the code where caused the error.
...
const UnauthedWrapper = () => {
const navigate = useNavigate();
const location = useLocation();
const {
state: { auth, user },
} = useContext(AppContext);
useEffect(() => {
if (auth && user && user.emailVerified && user.dstoreName) {
navigate(`/app/overview`);
return null;
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [auth, user]);
return (
<>
{!location.pathname.includes("/auth") ? (
<Header
logo="/images/logo.png"
page="landing"
hideLogin={process.env.REACT_APP_ENV === "PROD"}
/>
) : (
<Link to="/">
<img
src="/images/logo.png"
alt="logo"
className="logo ms-4 mt-4"
width={180}
/>
</Link>
)}
...