redux-persist

React Redux Persist is rehydrating, but no stored data is retrieved, instead, default

馋奶兔 提交于 2020-12-15 08:55:41
问题 I've been struggling with this problem for two days, so I need help! I have a React web in wich i've added Redux Persist (also Redux Saga for handling requests) as the documentation said. I'm testing with a store that doesn't have any saga in the middle, when I trigger an action, the data is updated, I can see it in the Debugger, but when i refresh, despite the Redux Hydrate process runs, that value goes back to the default one. store.js import { createStore, applyMiddleware, compose } from

React Redux Persist is rehydrating, but no stored data is retrieved, instead, default

若如初见. 提交于 2020-12-15 08:53:16
问题 I've been struggling with this problem for two days, so I need help! I have a React web in wich i've added Redux Persist (also Redux Saga for handling requests) as the documentation said. I'm testing with a store that doesn't have any saga in the middle, when I trigger an action, the data is updated, I can see it in the Debugger, but when i refresh, despite the Redux Hydrate process runs, that value goes back to the default one. store.js import { createStore, applyMiddleware, compose } from

Redux: My state is receiving '@@redux/INITi.8.g.w.a.m' Redux state not updating

大憨熊 提交于 2020-06-17 11:33:00
问题 I've been debugging why my state hasn't been changing and noticed this being logged in my reducer: { type: '@@redux/INITi.8.g.w.a.m' } This is the store which includes state, action types, reducer, actions: /* initial state */ import axios from 'axios'; export var usersStartState = { accountNotVerified: null, isLoggedIn: false, error: true, userAvatar: 'uploads/avatar/placeholder.jpg' }; /* action types */ export const actionTypes = { RESET_USER_ACCOUNT_IS_VERIFIED: 'RESET_USER_ACCOUNT_IS

Redux: My state is receiving '@@redux/INITi.8.g.w.a.m' Redux state not updating

Deadly 提交于 2020-06-17 11:28:05
问题 I've been debugging why my state hasn't been changing and noticed this being logged in my reducer: { type: '@@redux/INITi.8.g.w.a.m' } This is the store which includes state, action types, reducer, actions: /* initial state */ import axios from 'axios'; export var usersStartState = { accountNotVerified: null, isLoggedIn: false, error: true, userAvatar: 'uploads/avatar/placeholder.jpg' }; /* action types */ export const actionTypes = { RESET_USER_ACCOUNT_IS_VERIFIED: 'RESET_USER_ACCOUNT_IS

React- The states dont persits after refresh the page

大兔子大兔子 提交于 2020-04-17 21:28:25
问题 I made a SPA with React.js using PersisGate for states to persists but the states dont save after refresh the page. Also i see the LocalStorage at the Application tab (Chrome) and i can see the arrays of initialCart, initialCourses, initialUsers emptys but when i change the states at the pages those arrays that i can see at the LocalStorage stills empty. You can see my code bellow this is index.js import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App

React- The states dont persits after refresh the page

冷暖自知 提交于 2020-04-17 21:28:11
问题 I made a SPA with React.js using PersisGate for states to persists but the states dont save after refresh the page. Also i see the LocalStorage at the Application tab (Chrome) and i can see the arrays of initialCart, initialCourses, initialUsers emptys but when i change the states at the pages those arrays that i can see at the LocalStorage stills empty. You can see my code bellow this is index.js import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App

How to Read AsyncStorage on Android Correctly

為{幸葍}努か 提交于 2019-12-17 20:39:37
问题 It seems that it's possible access the AsyncStorage from Android (native); but I still struggling to make this work. In my React Native application, I have something like: Store const config = { ... } export const reducers = { ... user: user } let rootReducer = combineReducers(reducers) let reducer = persistReducer(config, rootReducer) User Reducer export class Actions { ... } const initialState = { first_name: : null, last_name: : null, email: null, addresses: [ { ... } ] } } } export const

Unable to save redux state with redux-persist

老子叫甜甜 提交于 2019-12-13 03:47:48
问题 I'm currently using redux-persist to persistent data storage in my react-redux application. I have set it up according to the documentation. I have tested it on a separate project with npx create-react-app . The persistent storage was working properly. When I integrate it in my actual working project, the state saving doesn't work. Can someone help me with this? Here is my store.js: import { createStore, applyMiddleware, compose } from 'redux'; import { routerMiddleware } from 'react-router

How to read or convert an image blob url into an image?

£可爱£侵袭症+ 提交于 2019-12-13 03:47:45
问题 I have an image that is stored in local storage. On load the image is displayed. componentDidMount() { const reader = new FileReader(); reader.onload = e => { this.setState({ blob: e.target.result }); }; reader.readAsDataURL(this.props.file); } render() { return ( <div> <img src={this.state.blob} /> </div> ) } The file object looks like this: lastModified:1535424554987 name:"test.jpeg" preview:"blob:http://localhost:8080/b52098ca-087f83c778f0" size:41698 type:"image/jpeg" webkitRelativePath:"