score:1

const App = () => {
  useEffect(() => {
    const isNewUser = localStorage.getItem("isNewUser")
      ? localStorage.getItem("isNewUser")
      : localStorage.setItem("isNewUser", false);
    if (!isNewUser) {
      navigate("/welcome");
    }
  });

  return (
    <div>
      <h1>Tutorial!</h1>
      <nav>
        <Link to="/">Home</Link>
        <Link to="dashboard">Dashboard</Link>
      </nav>
      <br />
      <Router primary="{false}">
          <ClientDocFolders path="/" />
          <WelcomePageContainer path="/welcome" />
          <ErrorNotFound default />
      </Router>
    </div>
  );
};


Related Query

More Query from same tag