How to replace all occurrences of a string? If a boolean attribute is present, its value is true, and if it’s absent, its value is false. In React you can conditionally render Components, but also their attributes, like props, className, id, and more. Since React components often take both custom and DOM-related props, it makes sense for React to use the camelCase convention just like the DOM APIs:This has not For boolean dom attributes true/false is preferred over repeating the attribute name/false, e.g. How do I return the response from an asynchronous call? The framework also defines and uses some new boolean attributes (e.g. For boolean dom attributes true/false is preferred over repeating the attribute name/false, e.g. The attributes property returns a collection of the specified node's attributes, as a NamedNodeMap object. An alternative way based on Andy Polhill's comment: The only small difference is that in the second example the inner component