Best practices when using react navigation and firebase auth together

Curious what the rest of the community does in terms of structuring apps that use both Firebase auth and React Navigation. Specifically, how do put both your navigator and auth listener in App.js. Ideally, I’d like to do the following:

export default class App extends React.Component {

  componentWillMount() {
    this.authListener = firebase.auth().onAuthStateChanged(user => {
      if (user) {
      } else {

  render() {
    return (
      <Provider store={store}>
        <AppNavigator onNavigationStateChange={null} />

The problem with this is that there’s no “this.props.navigation”. So I usually load a second “splash” screen first within the navigator and put my firebase auth listener there (it never gets unmounted if it’s the first screen of a stack navigator). But that seems kludgy. How all do you handle this?

1 Like