// pages/_app.js
import React from "react";
import {createStore} from "redux";
import {Provider} from "react-redux";
import App, {Container} from "next/app";
import withRedux from "next-redux-wrapper";
import configureStore from '../configureStore'

const reducer = (state = {foo: ''}, action) => {
    switch (action.type) {
        case 'FOO':
            return {...state, foo: action.payload};
        default:
            return state
    }
};

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

    render() {
        const {Component, pageProps, store} = this.props;
        return (
            <Container>
                <Provider store={store}>
                    <Component {...pageProps} />
                </Provider>
            </Container>
        );
    }

}

export default withRedux(configureStore)(MyApp);
@@ -45,16 +45,17 @@
 import %7B
+ 
 createSt
@@ -57,16 +57,17 @@
 ateStore
+ 
 %7D from %22
@@ -82,24 +82,25 @@
 import %7B
+ 
 Provider
 %7D from %22
@@ -91,16 +91,17 @@
 Provider
+ 
 %7D from %22
@@ -127,16 +127,17 @@
 t App, %7B
+ 
 Containe
@@ -137,16 +137,17 @@
 ontainer
+ 
 %7D from %22
@@ -232,16 +232,20 @@
 rom '../
+src/
 configur
@@ -257,208 +257,8 @@
 e'%0A%0A
-const reducer = (state = %7Bfoo: ''%7D, action) =%3E %7B%0A    switch (action.type) %7B%0A        case 'FOO':%0A            return %7B...state, foo: action.payload%7D;%0A        default:%0A            return state%0A    %7D%0A%7D;%0A%0A
 clas
@@ -279,18 +279,16 @@
 s App %7B%0A
-  
   static
@@ -309,17 +309,16 @@
 ialProps
- 
 (%7B Compo
@@ -328,28 +328,24 @@
 t, ctx %7D) %7B%0A
-    
     return %7B
@@ -345,20 +345,16 @@
 eturn %7B%0A
-    
       pa
@@ -372,20 +372,16 @@
         
-    
 ...(Comp
@@ -458,36 +458,22 @@
     
-    %7D%0A    
+%7D%0A
     %7D;%0A
-    
   %7D%0A%0A
-  
   re
@@ -489,19 +489,16 @@
     
- 
-   
 const %7B
+ 
 Comp
@@ -520,16 +520,17 @@
 s, store
+ 
 %7D = this
@@ -537,20 +537,16 @@
 .props;%0A
-    
     retu
@@ -550,22 +550,16 @@
 eturn (%0A
-      
       %3CC
@@ -576,24 +576,16 @@
         
-   
-     
 %3CProvide
@@ -611,26 +611,16 @@
         
-    
-      
 %3CCompone
@@ -648,24 +648,16 @@
         
-   
-     
 %3C/Provid
@@ -666,22 +666,16 @@
 %3E%0A      
-    
-  
 %3C/Contai
@@ -683,21 +683,15 @@
 er%3E%0A
-    
     );%0A
-  
   %7D%0A
@@ -742,8 +742,9 @@
 (MyApp);
+%0A

create _app.js default file