Skip to content

Commit

Permalink
Add package 'recompose'
Browse files Browse the repository at this point in the history
  • Loading branch information
phatnguyenuit committed Oct 21, 2020
1 parent 823da97 commit 6b7d68e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.0",
"recompose": "^0.30.0",
"redux": "^4.0.5",
"redux-saga": "^1.1.3"
},
Expand All @@ -38,6 +39,7 @@
"@types/node": "^13.11.1",
"@types/react": "^16.9.34",
"@types/react-redux": "^7.1.7",
"@types/recompose": "^0.30.7",
"@typescript-eslint/eslint-plugin": "^2.29.0",
"@typescript-eslint/parser": "^2.29.0",
"eslint": "^6.8.0",
Expand Down
9 changes: 7 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect } from 'react';
import { useEffect, ComponentType } from 'react';

import withRedux, { ReduxWrapperAppProps } from 'next-redux-wrapper';
import withReduxSaga from 'next-redux-saga';
Expand All @@ -7,6 +7,8 @@ import { AppContext } from 'next/app';
import { Provider } from 'react-redux';
import { ThemeProvider, CssBaseline } from '@material-ui/core';

import { compose } from 'recompose';

import configureStore from 'states/configureStore';
import { RootState } from 'states/rootReducer';
import MainLayout from 'layouts/Main';
Expand Down Expand Up @@ -36,7 +38,10 @@ function App({ Component, pageProps, store }: ReduxWrapperAppProps<RootState>) {
);
}

export default withRedux(configureStore)(withReduxSaga(App));
export default compose(
withRedux(configureStore),
withReduxSaga,
)(App as ComponentType<any>);

App.getInitialProps = async ({ Component, ctx }: AppContext) => {
const pageProps = Component.getInitialProps
Expand Down

1 comment on commit 6b7d68e

@vercel
Copy link

@vercel vercel bot commented on 6b7d68e Oct 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.