stef000
stef000

Reputation: 123

FormattedHTMLMessage not working after package-update (looking for alternative/fix)

We have recently updated our website's npm packages (react-intl version 4.5.1) and we are using react-intl. The problem is, that we used the FormattedHTMLMessage component which doesn't seem to be working anymore. If I visit the page now there are elements with classnames displayed in the text.

We display the text via props:

import React from "react";
import {
    FormattedMessage as FM,
    FormattedHTMLMessage as FHM
} from "react-intl";

export default props => {

return(
    ...
    <p className="fs-18 white-space-pre-line">
        <FM id={props.descriptionKey} />
    </p>
    ...
    );
};

and in the .json file for the text it looks like this:

textDescription: "Sometext <span class='font-tilde-bold h3'>Sometext</span> Sometext"

Is there any good alternative or should we generally use another approach?

Upvotes: 2

Views: 1750

Answers (1)

FormattedHTMLMessage was removed in version 4.

You can see in upgrade guild v3 -> v4.

Upvotes: 1

Related Questions