ソースを参照

refactor: Update shareCode in useEffect to avoid setState during render (#24468)

tags/1.8.0
Eric Guo 2ヶ月前
コミット
9260aa3445
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更3行の追加1行の削除
  1. 3
    1
      web/context/web-app-context.tsx

+ 3
- 1
web/context/web-app-context.tsx ファイルの表示

@@ -64,7 +64,9 @@ const WebAppStoreProvider: FC<PropsWithChildren> = ({ children }) => {

// Compute shareCode directly
const shareCode = getShareCodeFromRedirectUrl(redirectUrlParam) || getShareCodeFromPathname(pathname)
updateShareCode(shareCode)
useEffect(() => {
updateShareCode(shareCode)
}, [shareCode, updateShareCode])

const { isFetching, data: accessModeResult } = useGetWebAppAccessModeByCode(shareCode)
const [isFetchingAccessToken, setIsFetchingAccessToken] = useState(false)

読み込み中…
キャンセル
保存