3 ms·
This function name amuses me because it implies there is a “safelySetInnerHTML” method Also shouts out to the UNSAFE_component methods, you’re a real hipster i
by rmilejczz 3y ago
This function name amuses me because it implies there is a “safelySetInnerHTML” method
Also shouts out to the UNSAFE_component methods, you’re a real hipster if you used those before the prefix
- can16358p 3y agoNot exactly. If you are putting something inside the tag in React, you are implitly setting inner HTML the React way, managed by the virtual DOM. This method (actually not even a method but an attribute that probably calls a method if set) "bypasses" React to set the inner HTML of the element, hence "dangerous". (But I get what you mean of course, the reply was not to you but anyone who isn't familiar with React)
- rmilejczz 3y agoYou’re right it’s not even a method lol it’s a custom dom attribute. I had no idea