From 17a5e436b7b1cc0c1bd4624f50da111031f28bee Mon Sep 17 00:00:00 2001 From: bill bittner Date: Tue, 20 Feb 2018 14:31:05 -0800 Subject: [PATCH] updated Root to App, extracting provider and router --- react/app.js | 22 ++++++++++++++++++++++ react/index.js | 14 ++++++++++++-- react/root.js | 34 ---------------------------------- 3 files changed, 34 insertions(+), 36 deletions(-) create mode 100644 react/app.js delete mode 100644 react/root.js diff --git a/react/app.js b/react/app.js new file mode 100644 index 00000000..6e7267c0 --- /dev/null +++ b/react/app.js @@ -0,0 +1,22 @@ +import React from 'react'; +import { Route, Switch } from 'react-router-dom'; +import PublishPage from 'components/PublishPage'; +import AboutPage from 'components/AboutPage'; +import LoginPage from 'containers/LoginPage'; +import ShowPage from 'containers/ShowPage'; +import FourOhFourPage from 'components/FourOhFourPage'; + +const App = () => { + return ( + + + + + + + + + ); +}; + +export default App; diff --git a/react/index.js b/react/index.js index 239d0072..8ef02cf4 100644 --- a/react/index.js +++ b/react/index.js @@ -1,10 +1,14 @@ import React from 'react'; import { render } from 'react-dom'; +import { Provider } from 'react-redux'; import { createStore, applyMiddleware, compose } from 'redux'; +import { BrowserRouter } from 'react-router-dom'; import Reducer from 'reducers'; import createSagaMiddleware from 'redux-saga'; import rootSaga from 'sagas'; -import Root from './root'; + +import GAListener from 'components/GAListener'; +import App from './app'; const sagaMiddleware = createSagaMiddleware(); const middleware = applyMiddleware(sagaMiddleware); @@ -19,6 +23,12 @@ let store = createStore( sagaMiddleware.run(rootSaga); render( - , + + + + + + + , document.getElementById('react-app') ); diff --git a/react/root.js b/react/root.js deleted file mode 100644 index c4350ea9..00000000 --- a/react/root.js +++ /dev/null @@ -1,34 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { Provider } from 'react-redux'; -import { BrowserRouter, Route, Switch } from 'react-router-dom'; - -import GAListener from 'components/GAListener'; -import PublishPage from 'components/PublishPage'; -import AboutPage from 'components/AboutPage'; -import LoginPage from 'containers/LoginPage'; -import ShowPage from 'containers/ShowPage'; -import FourOhFourPage from 'components/FourOhFourPage'; - -const Root = ({ store }) => ( - - - - - - - - - - - - - - -); - -Root.propTypes = { - store: PropTypes.object.isRequired, -}; - -export default Root;