Implemented fixes from code review

This commit is contained in:
Martin Perry 2019-01-16 15:12:45 +00:00
parent adbcf5d4a4
commit f38e4747fa
5 changed files with 3498 additions and 1441 deletions

View File

@ -3,41 +3,40 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"bootstrap": "^4.1.3",
"connected-react-router": "^4.5.0",
"bootstrap": "4.2.1",
"connected-react-router": "6.2.1",
"jquery": "3.3.1",
"merge": "^1.2.1",
"history": "^4.7.2",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-redux": "^5.0.6",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.1",
"reactstrap": "^6.3.0",
"redux": "^4.0.1",
"redux-thunk": "^2.2.0",
"typescript": "3.1.5"
"merge": "1.2.1",
"history": "4.7.1",
"react": "16.7.0",
"react-dom": "16.7.0",
"react-redux": "6.0.0",
"react-router": "4.3.1",
"react-router-dom": "4.3.1",
"react-scripts": "2.1.3",
"reactstrap": "7.0.2",
"redux": "4.0.1",
"redux-thunk": "2.3.0",
"typescript": "3.2.2"
},
"devDependencies": {
"@types/history": "^4.7.2",
"@types/jest": "23.3.9",
"@types/node": "^10.12.1",
"@types/react": "^16.4.18",
"@types/react-dom": "^16.0.9",
"@types/react-redux": "^6.0.9",
"@types/react-router": "^4.0.4",
"@types/react-router-dom": "^4.0.4",
"@types/react-router-redux": "^5.0.16",
"@types/reactstrap": "^6.4.2",
"cross-env": "^5.2.0",
"@types/history": "4.7.2",
"@types/jest": "23.3.11",
"@types/node": "10.12.18",
"@types/react": "16.7.18",
"@types/react-dom": "16.0.11",
"@types/react-redux": "6.0.11",
"@types/react-router": "4.4.3",
"@types/react-router-dom": "4.3.1",
"@types/reactstrap": "6.4.3",
"cross-env": "5.2.0",
"eslint": "5.6.0",
"eslint-config-react-app": "3.0.5",
"eslint-plugin-flowtype": "3.2.0",
"eslint-config-react-app": "3.0.6",
"eslint-plugin-flowtype": "2.50.3",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-react": "7.11.1",
"typescript-eslint-parser": "21.0.1"
"typescript-eslint-parser": "21.0.2"
},
"scripts": {
"start": "react-scripts start",

View File

@ -81,4 +81,4 @@ class FetchData extends React.PureComponent<WeatherForecastProps> {
export default connect(
(state: ApplicationState) => state.weatherForecasts, // Selects which state properties are merged into the component's props
WeatherForecastsStore.actionCreators // Selects which action creators are merged into the component's props
)(FetchData);
)(FetchData as any);

View File

@ -6,7 +6,6 @@ import { Provider } from 'react-redux';
import { ConnectedRouter } from 'connected-react-router';
import { createBrowserHistory } from 'history';
import configureStore from './store/configureStore';
import { ApplicationState } from './store';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

View File

@ -1,7 +1,6 @@
import { applyMiddleware, combineReducers, compose, createStore, Reducer } from 'redux';
import thunk from 'redux-thunk';
import { connectRouter } from 'connected-react-router';
import { routerReducer, routerMiddleware } from 'react-router-redux';
import { connectRouter, routerMiddleware } from 'connected-react-router';
import { History } from 'history';
import { ApplicationState, reducers } from './';
@ -13,7 +12,7 @@ export default function configureStore(history: History, initialState?: Applicat
const rootReducer = combineReducers({
...reducers,
routing: routerReducer
router: connectRouter(history)
});
const enhancers = [];
@ -23,7 +22,7 @@ export default function configureStore(history: History, initialState?: Applicat
}
return createStore(
connectRouter(history)(rootReducer),
rootReducer,
initialState,
compose(applyMiddleware(...middleware), ...enhancers)
);