make footer sticky in react code example

Example 1: sticky footer react

.footer{
  margin-top: 1rem;
  padding: 1rem;
  background-color: rgb(235, 195, 64);
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
}

Example 2: how to make sticky footer with react router

<div id="container">
    <Header loaded={loaded} />
    <div id="main-content">
      <Switch>
        <Route
          path="/about"
          render={props => <About loaded={loaded} {...props} />}
        />
        <Route
          exact
          path="/"
          render={props => <MainPage loaded={loaded} {...props} />}
        />
        <Redirect to="/" />
      </Switch>
    </div>
    <Footer />
  </div>