0

I'm using react-translate-redux in a project for internationalization, but I don't know how to use translations in a component's properties. Specifically, I would like the title text of a component to be internationalized.

I would try the below,

<Button title={<Translate id="button">}>

but Type 'Element' is not assignable to type 'string'.

How can I internationalize the title text?

Kuai Le
  • 162
  • 11

1 Answers1

0

If you want to use Translate Component you can't pass it as a prop, you have to pass it as a child component and render it with this.props.children in your Button Render method.

If Button Component is a external component you have to use prop function like in this in Flavour 2