useSigninCheck suspends indefinitely
Mantenedores costumam responder em até 2 dias
@jhuleatt já está trabalhando nisso.
Desde 22/7/2021.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 3.6k
- Forks
- 403
- Merge médio
- 5d 5h
- PRs com merge (30d)
- 10
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de FirebaseExtended/reactfire
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 38/100
FirebaseExtended/reactfire#801 ·
Mantenedores costumam responder em até 2 dias
-
v5
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
FirebaseExtended/reactfire#793 ·
Mantenedores costumam responder em até 2 dias
-
v5
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
FirebaseExtended/reactfire#790 · 2 comentários ·
Mantenedores costumam responder em até 2 dias
-
v5
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
FirebaseExtended/reactfire#789 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
FirebaseExtended/reactfire#788 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de FirebaseExtended/reactfire