Answer the question
In order to leave comments, you need to log in
How to render html in react component?
Hello.
Got a project for support, it has a component for translations.
Which, given the key trans::key, returns a translation string, which may contain html.
The render looks like this (using TypeScript):
<Trans item="trans::key" />
const ComText = () => {
return (<Trans item="trans::key" />);
};
export default ComText;
Answer the question
In order to leave comments, you need to log in
dangerouslySetInnerHTML does not fly due to typescript
https://habrahabr.ru/post/13726/
https://ruseller.com/lessons.php?rub=37&id=347
www.internet-technologies.ru/articles/article_2077.html
https://habrahabr.ru/ post/114661/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question