Skip to content

Commit

Permalink
Make it so 404 doesn't rewrite the URL (#111)
Browse files Browse the repository at this point in the history
Confusing the user so that they don't know what URL they originally were
trying to visit is very unfriendly behavior.
  • Loading branch information
chennisden authored Jun 12, 2024
1 parent 0401af0 commit b74144a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions frontend/src/components/NotFoundRedirect.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { useEffect } from "react";
import { useNavigate } from "react-router-dom";
import NotFound from "pages/NotFound";

const NotFoundRedirect = () => {
const navigate = useNavigate();
useEffect(() => {
navigate("/404", { replace: true });
}, [navigate]);
return null;
return <NotFound />;
};

export default NotFoundRedirect;

0 comments on commit b74144a

Please sign in to comment.