React require(“history”).createBrowserHistory` instead of `require(“history/createBrowserHistory”)

Import creatBrowserHistory with curly brackets. It’s exported as a named export.

// history.js

import { createBrowserHistory } from "history";
export default createBrowserHistory(); 

Then import and use it in index.

// index.js
import history from "./history";
import { Provider } from "react-redux";
import store from "./store/store";

const AppContainer = () => (
    <Router history={history}>
        <Provider store={store}>
             <Route path="https://stackoverflow.com/" component={App} />
        </Provider>
    </Router>
);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)