I want to manage the content of the page from a content editor where I am getting page content from the API.
I used two different react modules for this react-html-parser and react-string-replace but it is still not working.
Here is my code.
let pageData = '';
pageData = ReactHtmlParser(page.content);
// replacing contact us form with a contact us form component
pageData = reactStringReplace(pageData, '{CONTACT_US_FORM}', (match, i) => (
<ContactUsForm />
));
return <div>{pageData}</div>;
react-html-parser -> It is used to parse HTML tags which are in string format into tree of elements.
react-string-replace -> It is used to replace a string into react a component.
Note: If I use react-html-parser or react-string-replace individually then it works fine but it does not work together.
Any suggestion?

react-string-replacedocumentation to see if you are using the API correctly. What doesReactHtmlParser()return? Is it a tree of elements? Doesreact-string-replacework on a tree of elements? What is{pageData}at the end of your code snippet supposed to do? Is this inside a React component?tree of elementsandreact-string-replacedoes not work with it. Either I need a different module that supports this or needs to do some modifications in the same code.page.contentlook like?