Skip to content

Commit

Permalink
Update hooks.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
42shadow42 committed Jun 3, 2022
1 parent f3d87dc commit 258b614
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/react-router/lib/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function useNavigate(): NavigateFunction {
);

let activeRef = React.useRef(false);
React.useEffect(() => {
React.useLayoutEffect(() => {
activeRef.current = true;
});

Expand All @@ -165,8 +165,6 @@ export function useNavigate(): NavigateFunction {
`your component is first rendered.`
);

if (!activeRef.current) return;

if (typeof to === "number") {
navigator.go(to);
return;
Expand Down

0 comments on commit 258b614

Please sign in to comment.