我有一个实用功能,可以帮助在反应组件中输入检查注入的商店
import { Diff } from 'typelevel-ts';
import * as React from 'react';
export type TypedInject<Stores> = <StoreKeyToInject extends keyof
Stores>(
...storeKeysToInject: StoreKeyToInject[]
) => <ExpectedProps extends Pick<Stores, StoreKeyToInject>>(
component: React.ComponentType<ExpectedProps>
) => React.ComponentType<Diff<ExpectedProps, Pick<Stores,
StoreKeyToInject>>>;
我收到一个错误“类型'Pick'不满足约束'keyof ExpectedProps'。类型'Pick'不可分配给类型'StoreKeyToInject'。”
你能解释一下它的作用以及如何解决它吗?