我正在遵循redux-persist页面上的文档,但我不知道它们是否是react原生的,因为我的导入有问题。我正在使用世博会。 以下是文档中告诉你应该使用的内容,而不是我实际必须使用的内容: import storage from 'redux-persist/lib/storage'
vs mine:
import storage from 'redux-persist/lib/defaults/asyncLocalStorage' 我需要导入的下一个文件是 import { PersistGate } from 'redux-persis
我试图添加redux-持久化到我的反应项目(使用类型记录)。但我有麻烦了。编译时会出现以下错误:
Could not find a declaration file for module 'redux-persist/lib/storage'. '.../WebstormProjects/catalog/node_modules/redux-persist/lib/storage/index.js' implicitly has an 'any' type.
Try `npm install @types/redux-persist` if
我正在做一个SPA使用反应。我想要在页面刷新后的状态,所以我使用‘redux-持久化’。我不知道我的导入'allReducers‘是否错误,因为我收到的消息是TypeError: baseReducer不是函数
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './components/App.jsx';
import * as serviceWorker from '
我开始学习redux,并尝试使用redux-persist来存储数据。因为redux- PersistGate现在已经更新到了v5,并建议使用PersistGate。但我几乎找不到关于PersistGate的文档。我写了一些代码,但是这个错误发生在PersistGate(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.,这是我的代码:
store.js
import thunk from
在我的react-native应用程序中,如果用户离线,我将使用redux-persist来显示商店中存在的数据。但是在添加redux-persist之后,我得到了错误state.merge is not a function。我认为这是一个不变性的错误。请帮我解决这个问题。 rootChangeReducer.js import * as types from '../actions/login/ActionTypes';
import Immutable from 'seamless-immutable';
const initialState = Im
我想在sessionStorage中存储与用户相关的属性,在localStorage中存储其他属性。通过下面的配置,我能够使用persist将所有属性存储在localStorage中
import reducers from './reducer';
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';
import autoMergeLevel2 from 'redux-
我正尝试在我的react-native项目中使用redux-persist设置一个jest快照测试。我不认为这是一个es2015导入的问题,因为我的测试代码看起来像这样:
import React from "react"
import "react-native"
// Note: test renderer must be required after react-native.
import renderer from "react-test-renderer"
import App from "../App
嗨,我试图让redux持久化,使用redux工具包(同样在类型记录中),我得到了以下错误:
Exported variable 'store' has or is using name '$CombinedState' from external module "home/..../node_modules/redux/index" but cannot be named.
我看到这个问题是在之前提出的,但也没有得到回答。
下面是我的代码,如果您对如何解决这个问题有什么想法,请告诉我,谢谢
import { configureStore, ge