3

I am using the react library react-intl. I am trying to return an empty string with FormattedHTMLMessage and when I am sending an id, that is mapping to an empty string:

"HeaderText.empty": "",

In return I don't get an empty string, it just renders the id.

<FormattedHTMLMessage id="HeaderText.empty" />

How can I get an empty string with FormattedHTMLMessage ?

Leff
  • 1,968
  • 24
  • 97
  • 201
  • You may want to share additional source, including how you are defining messages and configuring IntlProvider. – Will Oct 23 '18 at 13:51
  • The request @WillCain mentioned above is essential for us to be able to help you. Basically, you have the component as you showed, with an id and a defaultMessage. Then you have your message files per language. When you switch your locale, it should search for the message inside the specific language file, based on the id. if it doesn't find the id there, it shows the defaultMessage that you defined in the component, and, if you just want to return an empty string, you can just define the message as an empty space, for example. – sergioviniciuss Nov 01 '18 at 09:59

0 Answers0