You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is very important if you turn on "strict": true, in the tsconfig. I've written my own '.d.ts' file so I can get Webpack to create output. Until I come up with some sort of fix I'm done... I just put it in the node_modules/@types/redux-localstorage and name it "index.d.ts" and the transpiler has no trouble finding it. Here's the file (I only needed the 'persistState' function. Notice, it is completely different from the above 'persistState' function type definition.
// Type definitions for redux-localstorage persistState, until a better solution becomes available
import * as Redux from "redux";
export interface ConfigRS {
key: string;
merge?: any;
slicer?: any;
serialize: (value: any, replacer?: (key: string, value: any) => any, space?: string | number) => string,
deserialize: (text: string, reviver?: (key: any, value: any) => any) => any
}
export default function persistState(paths: string | string[], config: ConfigRS): Redux.GenericStoreEnhancer;
When attempting to use
persistState( ... )
type definition is incorrect, typing information is possibly out of date.Sample code throwing error:
Code works fine without
@types/redux-localstorage
installed, this is the current workaround.See index.d.ts in
@types/redux-localstorage
below:The text was updated successfully, but these errors were encountered: