1

I got some error with interpolation in Trans component in next-i18next. Instead of proper link I get [Object object]. When I check the translation value in React Developers Tools I see that everything is ok.

Here is my usage of this component: <Trans>{translation.key}</Trans>

translation.key is already translated value with html tags in it. I tried many solutions but every time give me [Object object]

I tried literally each solution on stackoverflow but every time I got the same result.

1 Answers1

0

The error with {translation.key} returning [object Object] is caused because you're returning also the <a> tag, creating a React Node (or [object Object]).

To solve the problem do not return the anchor tag directly inside the key.

giosan
  • 291
  • 1
  • 4
  • 15