The maximum update depth exceeded. This can happen when a component repeatedly calls setState inside `componentWillUpdate` or `componentDidUpdate`. React limits the number of nested updates to prevent infinite loops.

```
  import React, { Component } from "react";
  import { BrowserRouter, Route, Redirect, Switch } from "react-router-dom"; 
  import Login from "./component/auth/Login";
  import HomeScreen from "./component/home-screen/HomeScreen";
       class App extends Component {
           constructor(props) {
            super(props);

              this.state = {
                   user: {}
                 };
                 }

              componentDidMount() {
                    this.authListener();
               }

     authListener() {
firebase.auth().onAuthStateChanged(user => {
  if (user) {
    this.setState({ user });
  } else {
    this.setState({ user: null });
  }
});
}

render() {
  return (
  <BrowserRouter>
    <div className="App">
      <Switch>
        <Route exact path="/" component={Landing} />
        {this.state.user ? (
          <Redirect to="/homescreen" />
        ) : (
          <Redirect to="/login" />
        )}
        <Route exact path="/login" component={Login} />
        <Route exact path="/homescreen" component={HomeScreen} />
        <Route exact path="/users" component={Users} />
        <Route exact path="/users/:id" component={UserDetail} />
        <Route component={Error} />
      </Switch>
    </div>
  </BrowserRouter>
);
}
}

 export default App;

```