fix: 修复在某些时候跳转引用过时导致无法跳转的bug

pull/64/head
moonrailgun 3 years ago
parent a202419669
commit 5c230caef3

@ -33,7 +33,7 @@ export const GuestView: React.FC = React.memo(() => {
} else {
navigate('/main');
}
}, [nickname, history, navRedirect]);
}, [nickname, navigate, navRedirect]);
return (
<div className="w-96 text-white">

@ -69,7 +69,7 @@ export const LoginView: React.FC = React.memo(() => {
} else {
navigate('/main');
}
}, [email, password, history, navRedirect]);
}, [email, password, navRedirect, navigate]);
const navToView = useNavToView();

@ -16,7 +16,7 @@ export function useNavToView() {
pathname,
});
},
[history]
[navigate, location]
);
return navToView;

@ -32,7 +32,7 @@ export const FriendList: React.FC<{
const converse = await createDMConverse([targetId]);
navigate(`/main/personal/converse/${converse._id}`);
},
[history]
[navigate]
);
const handleRemoveFriend = useCallback(async (targetId: string) => {

@ -53,7 +53,7 @@ function useAppState() {
setupRedux(socket, store);
return { store, socket };
}, [history]);
}, []);
const store = value?.store;
const socket = value?.socket;

Loading…
Cancel
Save