Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-konshin committed Nov 1, 2022
1 parent 58b47bb commit 2f10b94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/wrapper/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export const createWrapper = <S extends Store>(makeStore: MakeStore<S>, config:
delete resultProps.pageProps.initialProps;
}

return {store, props: {...initialProps, ...resultProps}};
return {store, props: {...initialProps, ...resultProps, Component}};
};

const withRedux = (Component: NextComponentType | App | any) => {
Expand All @@ -239,7 +239,7 @@ export const createWrapper = <S extends Store>(makeStore: MakeStore<S>, config:

//TODO Check if pages/_app was wrapped so there's no need to wrap a page itself
const WrappedComponent = (props: any) => {
const {store, props: combinedProps} = useWrappedStore({Component, ...props}, WrappedComponent.displayName);
const {store, props: combinedProps} = useWrappedStore({Component, ...props}, WrappedComponent.displayName); // Component goes first for _app which has props.component

return (
<Provider store={store}>
Expand Down

0 comments on commit 2f10b94

Please sign in to comment.