Как использовать response-i18следующий с Namespaces в форме antd - PullRequest
0 голосов
/ 04 марта 2019

Я новичок в i18, следующий за машинописным текстом, и я хочу перевести форму antd, используя withNamespaces

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

Как правильно это сделать?Thx.

1 Ответ

0 голосов
/ 05 марта 2019

Если у кого-то есть такая же проблема, можно использовать пакет recompose.

https://github.com/acdlite/recompose

Затем сделайте что-то вроде этого:

import { compose} from 'recompose'

{...}

export default compose(withNamespaces())(Form.create()(MyComponent))

...