TypeError: Cannot read property 'push' of undefined

(Apologies if this is out of the scope of Okta).

I am following the Okta Sign-In Widget and React documentation (https://developer.okta.com/code/react/okta_react_sign-in_widget/).

I get the type error ‘Cannot read property ‘push’ of undefined’ when I try and navigate to the SecureRoute admin-login as routed here in my App.js:

import React, { Component } from 'react';
import { BrowserRouter as Router, Switch, Route, browserHistory } from 'react-router-dom'
import { Security, SecureRoute, ImplicitCallback } from '@okta/okta-react'
import './App.css';
import './css/bootstrap.min.css';
import Home from './pages/Home';
import HowTo from './pages/HowTo';
import ContactUs from './pages/ContactUs';
import AdminDashboard from './pages/AdminDashboard';
import ResultPage from './pages/ResultPage';
import NavBar from './components/NavBar'
import Login from './pages/Login';

function onAuthRequired({ history }) {

/* Main component which holds the routing to each page */
class App extends Component {
  render() {
    return (
        <Security issuer='{mydomain}/oauth2/default'
          redirectUri={window.location.origin + '/implicit/callback'}
          pkce={true} >
          <NavBar />
          <div className="container">
            <Route exact path="/" component={Home} />
            <Route path="/ResultPage" component={ResultPage} />
            <Route path="/how-to" component={HowTo} />
            <Route path="/contact-us" component={ContactUs} />
            <Route path='/login' render={() => <Login baseUrl='mydomain' />} />
            <Route path='/implicit/callback' component={ImplicitCallback} />
            <SecureRoute path="/admin-dashboard" component={AdminDashboard} />

export default App;

The AdminDashboard component that is in that secured route is in my components folder, and the components folder and my App.js are in my src folder.

Also note my domains and client ids are correct in my code but abstracted here.

Any help would be appreciated. Thank you!