rt2zz / redux-persist

persist and rehydrate a redux store
MIT License
12.94k stars 866 forks source link

PersistGate component props typescript declaration typo #1356

Open ashik112 opened 2 years ago

ashik112 commented 2 years ago

While using PersistGate component with typescript the following error shows with prop persistor (redux-persist version: ^6.0.0)

<PersistGate loading={null} persistor={persistor}>...</PersistGate>
  Overload 1 of 2, '(props: PersistGateProps | Readonly<PersistGateProps>): PersistGate', gave the following error.
    Type '{ children: Element; loading: null; persistor: any; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<PersistGate> & Readonly<PersistGateProps> & Readonly<...>'.
      Property 'persistor' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<PersistGate> & Readonly<PersistGateProps> & Readonly<...>'. Did you mean 'persister'?
  Overload 2 of 2, '(props: PersistGateProps, context: any): PersistGate', gave the following error.
    Type '{ children: Element; loading: null; persistor: any; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<PersistGate> & Readonly<PersistGateProps> & Readonly<...>'.
      Property 'persistor' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<PersistGate> & Readonly<PersistGateProps> & Readonly<...>'. Did you mean 'persister'?