我是i18打字机的新手,我想使用withNamespaces转换antd形式
export default withNamespaces()(Form.create()(MyComponent));
这给了我以下错误:
Argument of type 'ComponentClass<RcBaseFormProps & Pick<any, string | number | symbol>, any>' is not assignable to parameter of type 'ComponentType<WithNamespaces>'.
Type 'ComponentClass<RcBaseFormProps & Pick<any, string | number | symbol>, any>' is not assignable to type 'ComponentClass<WithNamespaces, any>'.
Type 'RcBaseFormProps & Pick<any, string | number | symbol>' is missing the following properties from type 'WithNamespaces': tReady, i18n, t
什么是正确的方法?谢谢。
答案 0 :(得分:0)
如果有人遇到相同的问题,可以使用recompose
软件包。
https://github.com/acdlite/recompose
然后执行以下操作:
import { compose} from 'recompose'
{...}
export default compose(withNamespaces())(Form.create()(MyComponent))