As you know, with styled-component you may extend an HTML tag and define an attribute immediately. That’s very useful when you need to use a component often.
Category / ReactJS
Of course, you know dangerouslySetInnerHTML attribute. This is very useful when you need to insert a custom own HTML in your page. …is React’s replacement for using innerHTML in the browser DOM. In general, setting HTML from code is risky because it’s easy to inadvertently expose your users to a cross-site scripting (XSS) attack. So, you […]
Let’s say you are using the simple stateless component below:
I have updated to version 2.0.0 my React Switch button control component. This is a Switch control built with and for React. In this new version, I’ve rewritten the component model with some alignment for ES6. Also, I’ve added the disabled feature. You can see a Demo example here.