refactor: Update shareCode in useEffect to avoid setState during render (#24468)
This commit is contained in:
parent
6010d5f24c
commit
9260aa3445
1 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue