Skip to content

useUser returns value null within AuthCheck children after signing out #249

@andrei-yanovich

Description

@andrei-yanovich

Reopening issue #155 , since AuthCheck is not entirely working.

Version info

React: 16.12

Firebase: 7.14

ReactFire: 2.0.3

Test case

https://codesandbox.io/s/pensive-fire-2v5qn?file=/src/config.js

Steps to reproduce

  • Use a private component (App) as a child of AuthCheck and Login as a fallback
  • Login using the form, App component with the user email should be rendered
  • reload the page
  • press sign out

Expected behavior

All children of AuthCheck shouldn't be rendered if there is no user logged in

Actual behavior

App component render fails with Cannot read property 'email' of null, because of useUser returning null. Happens only if an application is loaded with an active session.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions