Skip to content

Instantly share code, notes, and snippets.

@vschoener
Created July 26, 2018 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vschoener/b7aa6bb60a178697fcb39b587192e389 to your computer and use it in GitHub Desktop.
Save vschoener/b7aa6bb60a178697fcb39b587192e389 to your computer and use it in GitHub Desktop.
React index
import * as React from 'react';
import { render as ReactRender } from 'react-dom';
import { Provider } from 'react-redux';
import { Router, Route } from 'react-router-dom';
import './scss/main.scss';
import SignIn from './components/auth/signin/SignIn';
import SignUp from './components/auth/signup/SignUp';
import Event from './components/dashboard/event/Event';
import AuthorizedRoute from './hoc/AuthorizedRouteHOC';
function render() {
ReactRender(
<Provider store={store}>
<Router history={history}>
<App>
<Route exact path="/" component={Home} />
<Route path="/signIn" component={SignIn} />
<Route path="/signUp" component={SignUp} />
<AuthorizedRoute path="/dashboard/event" component={Event} />
</App>
</Router>
</Provider>
,
document.getElementById('root'),
);
}
// This is required to have saga information using devTools
render();
// Need to read back the doc about it :)
store.subscribe(render);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment