type HydrateStoreDecorator = (storeName: string, showPreloader?: boolean, onSuccess?:any) => (WrappedComponent: Component) => Component;
export const hydrateStore: HydrateStoreDecorator = (storeName,
showPreloader = true,
onSuccess = null) =>
WrappedComponent => {...}
Я понимаю, что я делаю что то неверно, но не могу понять что. Пишет ошибку
TS2322: Type '(storeName: string, showPreloader?: boolean, onSuccess?: any) => (WrappedComponent: Component<{},...' is not assignable to type 'HydrateStoreDecorator'.
Type '(WrappedComponent: Component<{}, {}, any>) => typeof (Anonymous class)' is not assignable to type '(WrappedComponent: Component<{}, {}, any>) => Component<{}, {}, any>'.
Type 'typeof (Anonymous class)' is not assignable to type 'Component<{}, {}, any>'.
Property 'setState' is missing in type 'typeof (Anonymous class)'
@typescript_ru
Обсуждают сегодня