I am trying to fire up a legacy React v14 project and all I did was refactor a bit the index.js
file, the root level index.js
file to look like this:
import React from "react";
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { createStore, applyMiddleware } from "redux";
import { Router, Route, IndexRoute, browserHistory } from "react-router";
import App from "./components/app";
import reducers from "./reducers";
const createStoreWithMiddleware = applyMiddleware()(createStore);
ReactDOM.render(
<Provider store={createStoreWithMiddleware(reducers)}>
<Router history={browserHistory}>
<Route path='/' component={App}></Route>
</Router>
</Provider>,
document.querySelector(".container")
);
And as a result I get an error in console that says:
Uncaught TypeError: Cannot read properties of undefined (reading
‘func’)