Skip to content

Commit

Permalink
fix(maleo-redux-plugin): fix store undefined (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinkl authored Jun 10, 2019
1 parent e88e7c5 commit 9cd37a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/redux-plugin/src/withRedux.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,16 @@ export const withRedux = (makeStoreClient) => {
store: storedReduxStore,
};

// Return store in any condition in order for Provider to receive the store
if (typeof Wrap.getInitialProps === 'function') {
const wrapInitialProps = await Wrap.getInitialProps.call(Wrap, context);
return wrapInitialProps;
return { ...wrapInitialProps, store: storedReduxStore };
}

return null;
return { store: storedReduxStore };
} catch (err) {
console.error('[@airy/maleo-redux-plugin]', err);
return null;
return { store: storedReduxStore };
}
};

Expand Down

0 comments on commit 9cd37a4

Please sign in to comment.