Line 22:6: React Hook useEffect has a missing dependency: 'auth.token'. Either include it or remove the dependency array
Error webpackHotDevClient.js:115 ./src/components/Layout/Routes/private.js Line 22:6: React Hook useEffect has a missing dependency: 'auth.token'. Either include it or remove the dependency array Line 22:7: React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked react-hooks/exhaustive-deps Private.js import { useState, useEffect } from "react"; import { useAuth } from "../../../context/auth"; import React from "react"; import { Outlet } from "react-router-dom"; import axios from "axios"; import Spinner from "../../spinner"; export default function PrivateRoute() { const [ok, setOk] = useState(false); const [auth] = useAuth(); useEffect(() => { const authCheck = async () => { const res = await axios.get("/api/v1/auth/user-auth"); if (res.data.ok) { setOk(true); } else { ...