useSigninCheck suspends indefinitely
@jhuleatt đang làm issue này rồi.
Từ ngày 22/7/2021.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.6k
- Fork
- 403
- Merge trung bình
- 5 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FirebaseExtended/reactfire
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
FirebaseExtended/reactfire#801 ·
-
v5
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
FirebaseExtended/reactfire#793 ·
-
v5
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
FirebaseExtended/reactfire#790 · 2 bình luận ·
-
v5
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
FirebaseExtended/reactfire#789 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
FirebaseExtended/reactfire#788 ·
Tất cả issue của FirebaseExtended/reactfire
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
bcgov/bc-wallet-mobile#4761 · 1 bình luận ·
-
external-issue to-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100