react-i18nify
react-i18nify copied to clipboard
Typescript error using the render method
Hi,
I am migrating a js project that uses react-i18nify to Typescript. In many cases in the app I see the developer is using the render prop like this:
<I18n
render={() => {
But the Typescript type does not expose this prop:
export class I18n extends React.Component {}
Therefore you get a "Property 'render' does not exist on type" error.
Many thanks.
I'm not sure if this is right, but this seems to suppress the errror:
export interface I18nRender {
render: () => JSX.Element
}
export class I18n<T extends I18nRender> extends React.Component<T, {}> { }