createPage([...connectArgs])(Page, [reducers])
Last updated
Last updated
Configures and connects to Redux store, loads reducers dynamically, handles client side URL redirection, and makes cookie, default locale, locale, and site locales available as Page
props and in the getInitialProps
lifecycle method.
It will also make them available to the component hierarchy below, through the following method calls:
Cookie through withCookies
calls, imported from react-cookie
.
Default locale, locale, and site locales through withLocale
calls, imported from soya-next/i18n
.
[...connectArgs
] ()
Page
(ReactComponent): Page component to be enhanced.
[reducers
] (Object): An object of reducers which will be loaded dynamically with the given name.
Note: Make sure each reducers has unique name within your application reducers.
(ReactComponent): An enhanced Page component class.