From 98eb9153662eb0f3ee56d5ebb5760a3894e864f9 Mon Sep 17 00:00:00 2001 From: makabe Date: Wed, 15 Mar 2023 11:55:18 +0900 Subject: [PATCH] =?UTF-8?q?=E8=A8=80=E8=AA=9E=E5=88=87=E3=82=8A=E6=9B=BF?= =?UTF-8?q?=E3=81=88=E3=82=92=E6=8F=8F=E7=94=BB=E5=89=8D=E3=81=AB=E5=AE=9F?= =?UTF-8?q?=E6=96=BD=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dictation_client/src/App.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dictation_client/src/App.tsx b/dictation_client/src/App.tsx index 3468864..25ff190 100644 --- a/dictation_client/src/App.tsx +++ b/dictation_client/src/App.tsx @@ -3,7 +3,7 @@ import { BrowserRouter } from "react-router-dom"; import { PublicClientApplication } from "@azure/msal-browser"; import { MsalProvider, useMsal } from "@azure/msal-react"; import { msalConfig } from "common/msalConfig"; -import { useEffect } from "react"; +import { useEffect, useLayoutEffect } from "react"; import { useDispatch } from "react-redux"; import globalAxios, { AxiosError, AxiosResponse } from "axios"; import { clearToken } from "features/auth"; @@ -35,7 +35,8 @@ const App = (): JSX.Element => { }, [dispatch, instance]); // Language読み取り - useEffect(() => { + // AADB2Cからのリダイレクト後にレンダリングより先に言語切り替えしたいのでuseLayoutEffectを使う + useLayoutEffect(() => { const language = document.cookie .split(";") .map((x) => x.split("="))