Skip to content

Commit

Permalink
reactrouterdom v5 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sritanmotati committed Feb 28, 2025
1 parent 7d29d70 commit d85eb23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/review/src/pages/HealthPage.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React, { useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { useHistory } from "react-router-dom";

const Health = () => {
const navigate = useNavigate();
const history = useHistory();

useEffect(() => {
// Check user agent on client side
const userAgent = navigator.userAgent;
if (userAgent !== "service-status") {
navigate("/", { replace: true });
history.push("/", { replace: true });
}
}, [navigate]);
}, [history]);

return <div>OK</div>;
};
Expand Down

0 comments on commit d85eb23

Please sign in to comment.