Skip to content

Instantly share code, notes, and snippets.

@ttristan
Created March 23, 2018 08:15
Show Gist options
  • Save ttristan/fd135b0623c25edd345601062502a287 to your computer and use it in GitHub Desktop.
Save ttristan/fd135b0623c25edd345601062502a287 to your computer and use it in GitHub Desktop.
import React from "react";
import ReactDOM from "react-dom";
import App from "./components/App.js";
// redux
import { Provider } from "react-redux";
import { createStore, applyMiddleware } from "redux";
import thunk from "redux-thunk";
import rootReducer from "./reducers/root.reducer.js";
// router
import { Route } from "react-router";
// redux & router
import createHistory from "history/createBrowserHistory";
import { ConnectedRouter, routerMiddleware } from "react-router-redux";
// css
import "font-awesome/css/font-awesome.min.css";
// TODO ...
// setup
const history = createHistory();
const routeMiddleware = routerMiddleware(history);
const store = createStore(rootReducer, applyMiddleware(thunk, routeMiddleware));
ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<Route path="/" component={App} />
</ConnectedRouter>
</Provider>,
document.getElementById("root")
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment