79633781

Date: 2025-05-22 12:53:53
Score: 1
Natty:
Report link

Here’s how you can safely render your HTML string:

const myObject = "<span style='color: red;'>apple</span>tree";

return (
  <div dangerouslySetInnerHTML={{ __html: myObject }} />
);

Optional: JSX Alternative

return (
  <div>
    <span style={{ color: 'red' }}>apple</span>tree
  </div>
);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Live Stream