Closed RomainClem closed 1 year ago
Found a solution using dangerouslySetInnerHTML: `import React from 'react';
const MyComponent = ({ htmlContent }) => { return ( <div dangerouslySetInnerHTML={{ __html: htmlContent }} /> ); };
export default MyComponent; `
The code isn't sanitized which isn't great. Would probably be best to sanitize it first, here is an example: `import React from 'react';
Found a solution using dangerouslySetInnerHTML: `import React from 'react';
const MyComponent = ({ htmlContent }) => { return ( <div dangerouslySetInnerHTML={{ __html: htmlContent }} /> ); };
export default MyComponent; `
The code isn't sanitized which isn't great. Would probably be best to sanitize it first, here is an example: `import React from 'react';
const MyComponent = ({ htmlContent }) => { return ( <div dangerouslySetInnerHTML={{ __html: htmlContent }} /> ); };
export default MyComponent; `