4 ms·
I particularly enjoy React's dangerouslySetInnerHTML syntax ``` <div dangerouslySetInnerHTML={__html: '<p>hello world</p>'} /> ``` Like they're BEGGING you to
by tmpz22 7y ago
I particularly enjoy React's dangerouslySetInnerHTML syntax
```
<div dangerouslySetInnerHTML={__html: '<p>hello world</p>'} />
```
Like they're BEGGING you to never use it but understand sometimes it may be necessary or at least is needed to avoid worse hacks to achieve the same function.
I've taken to using prefixes like DANGEROUS or UNSAFE in various parts of our codebase to better indicate to the user where extra caution is needed.