ElectronHacked / nextjs-typescript-antd

Yoman Generator for https://github.com/ElectronHacked/nextjs-typescript-antd! It's based on NextJS, TypeScript, Antd
https://github.com/ElectronHacked/nextjs-typescript-antd
MIT License
30 stars 5 forks source link

How to call redux dispatch action in Next js _app.js ? #7

Closed rimsila closed 4 years ago

rimsila commented 4 years ago

` export default class MyApp extends App { static async getInitialProps({ Component, ctx }) { const pageProps = Component.getInitialProps ? await Component.getInitialProps(ctx) : {}; return { pageProps }; }

render() {

const { Component, pageProps } = this.props;
return (
  <Container>
    <Provider store={store}>
      <PersistGate loading={<LoadingSpinner />} persistor={persistor}>
        <CustomErrorBoundary>
          <Component {...pageProps} />
        </CustomErrorBoundary>
      </PersistGate>
    </Provider>
  </Container>
);

} } `