useSigninCheck suspends indefinitely
@jhuleatt 已經在處理了。
開始於 2021年7月22日。
評估
這個 Issue 還沒有評估資料。
描述
I would like to create a protected route with reactfire and react-router-dom. To achieve this, I created a PrivateRoute component as follows:
export default function PrivateRoute(routeProps: RouteProps) {
const { status, data: signInCheckResult, error } = useSigninCheck();
if (signInCheckResult.signedIn) {
return <Route {...routeProps} />;
} else {
return (
<Redirect
to={{ pathname: "/signin", state: { from: routeProps.path } }}
/>
);
}
}
I enabled suspense mode for reactfire.
Oddly, when staying on a single page for around ~1min, navigating to another page would cause the component to suspend indefinitely. Reloading the page, however, does momentarily unsuspend the page (but the effect would reappear after idle).
Version info
"firebase": "8.7.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-router-dom": "5.2.0",
"react-scripts": "4.0.0",
"reactfire": "3.0.0-rc.2"
Test case
https://codesandbox.io/s/reactfire-suspend-demo-i3j1e
Steps to reproduce
- Click on
Sign in with Googleand proceed. - You should land in a
signed inpage with a log out button and alink to test page. - Wait for at least 30 seconds (idle).
- Click on
Link to test page(React Router Link) - Page would suspend indefinitely.
Expected behavior
Page shouldn't suspend indefinitely.
Actual behavior
Page suspends indefinitely.
Please let me know if there are any good implementations for integrating reactfire with react-router-dom.
- 主要語言
- TypeScript
- 星號
- 3.6k
- 分支
- 403
- 平均合併
- 5 天 1 小時
- 30 天內合併 PR
- 10
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
FirebaseExtended/reactfire 的其他 Issue
-
難度 5/5 一週以上 新手友好度 38/100
FirebaseExtended/reactfire#801 ·
-
v5
難度 4/5 3-5 天 新手友好度 48/100
FirebaseExtended/reactfire#793 ·
-
v5
難度 4/5 3-5 天 新手友好度 35/100
FirebaseExtended/reactfire#790 · 2 則留言 ·
-
v5
難度 4/5 3-5 天 新手友好度 55/100
FirebaseExtended/reactfire#789 ·
-
難度 5/5 一週以上 新手友好度 35/100
FirebaseExtended/reactfire#788 ·
查看 FirebaseExtended/reactfire 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
bcgov/bc-wallet-mobile#4761 · 1 則留言 ·
-
external-issue to-triage
難度 2/5 1-3 小時 新手友好度 88/100
-
area-deployment area-integrations triage:bot-seen
難度 2/5 半天 新手友好度 86/100
-
難度 2/5 1-3 小時 新手友好度 82/100
-
refactor
難度 2/5 1-3 小時 新手友好度 84/100