Ammar Tariq
Ammar Tariq

Reputation: 847

Redux-Persist not working on [email protected]

I have been using redux-persist for about 6 months, it never happened but this time in my new project redux-persist is not working I don't know what's the reason. Please note that I cannot downgrade as I'll have to re-eject the project and I can't do that. Need a quick fix.

Any help will be appreciated. Thanks.

My Package.json

      "dependencies": {
        "@ptomasroos/react-native-multi-slider": "^1.0.0",
        "@react-native-community/async-storage": "^1.5.1",
        "native-base": "2.12.1",
        "react": "16.8.6",
        "react-native": "0.60.4",
        "react-native-animatable": "^1.3.2",
        "react-native-calendar-picker": "^6.0.1",
        "react-native-calendar-strip": "^1.3.8",
        "react-native-calendars": "^1.200.0",
        "react-native-document-picker": "^3.2.4",
        "react-native-gesture-handler": "^1.3.0",
        "react-native-image-picker": "^1.0.1",
        "react-native-linear-gradient": "^2.5.4",
        "react-native-parallax-scroll-view": "^0.21.3",
        "react-native-permissions": "^1.2.0",
        "react-native-progress-bar-animated": "^1.0.6",
        "react-native-ratings": "^6.3.1",
        "react-native-render-html": "^4.1.2",
        "react-native-scaling-drawer": "^1.0.1",
        "react-native-snap-carousel": "^3.8.0",
        "react-native-splash-screen": "^3.2.0",
        "react-native-star-rating": "^1.1.0",
        "react-native-toast": "^1.0.1",
        "react-native-vector-icons": "^6.6.0",
        "react-native-wheel-picker-android": "^2.0.5",
        "react-navigation": "^3.11.1",
        "react-redux": "^7.1.0",
        "redux": "^4.0.4",
        "redux-persist": "5.6.12",
        "redux-thunk": "^2.3.0",
        "rn-range-slider": "^1.2.5"
      },
      "devDependencies": {
        "@babel/core": "7.5.5",
        "@babel/runtime": "7.5.5",
        "@react-native-community/eslint-config": "0.0.3",
        "babel-jest": "24.8.0",
        "eslint": "6.0.1",
        "jest": "24.8.0",
        "metro-react-native-babel-preset": "0.54.1",
        "react-test-renderer": "16.8.6"
      },
      "jest": {
        "preset": "react-native"
      }
    }

Upvotes: 1

Views: 292

Answers (1)

Ammar Tariq
Ammar Tariq

Reputation: 847

I was able to resolve this issue by adding "persist/REHYDRATE" action in my reduces, However I have no idea what this action does but resolved my issue

case "persist/REHYDRATE":{
 return{
    ...action.payload.global
  }
}

Where global is the name of my reduces

Upvotes: 1

Related Questions