From 79f547b2748114590545824d21c877fdb6c4d88e Mon Sep 17 00:00:00 2001 From: Titouan Rigoudy Date: Sun, 7 Nov 2021 18:01:09 +0100 Subject: [PATCH] Use typed selector hooks. --- src/components/ConnectPage.tsx | 4 ++-- src/components/Footer.tsx | 6 +++--- src/components/SolsticeApp.tsx | 4 ++-- src/modules/room/RoomsPane.tsx | 6 +++--- src/modules/user/UsersPane.tsx | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/ConnectPage.tsx b/src/components/ConnectPage.tsx index 40fa2b4..13a2dca 100644 --- a/src/components/ConnectPage.tsx +++ b/src/components/ConnectPage.tsx @@ -1,12 +1,12 @@ -import { useSelector } from "react-redux"; import { useLocation } from "react-router"; import { Redirect } from "react-router-dom"; +import { useAppSelector } from "app/hooks"; import ConnectForm from "components/ConnectForm"; import { selectSocket, SocketState } from "modules/socket/slice"; const ConnectPage: React.FC = () => { - const socket = useSelector(selectSocket); + const socket = useAppSelector(selectSocket); const location = useLocation(); // If the socket is open and we are logged in, we can proceed to the app. diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 9ce7617..15c0abd 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,14 +1,14 @@ import { FC } from "react"; -import { useSelector } from "react-redux"; +import { useAppSelector } from "app/hooks"; import LoginStatusPane from "modules/login/LoginStatusPane"; import { selectLogin } from "modules/login/slice"; import { selectSocket } from "modules/socket/slice"; import SocketStatusPane from "modules/socket/SocketStatusPane"; const Footer: FC = () => { - const login = useSelector(selectLogin); - const socket = useSelector(selectSocket); + const login = useAppSelector(selectLogin); + const socket = useAppSelector(selectSocket); return (