![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-classset
Advanced tools
classSet()
is a neat utility for easily manipulating the DOM class
string. This previously resided inside React as a utility, but is now pulled out and library-agnostic.
Here's a common scenario
var classString = 'message';
if (isImportant) {
classString += ' message-important';
}
if (isRead) {
classString += ' message-read';
}
This can quickly get tedious, as assigning class name strings can be hard to read and error-prone. classSet()
solves this problem:
var classString = classSet({
'message': true,
'message-important': isImportant,
'message-read': isRead
});
When using classSet()
, pass an object with keys of the CSS class names you might or might not need. Truthy values will result in the key being a part of the resulting string.
Alternatively, you can also use it this way:
cx('a', 0, null, undefined, 'b'); // 'a 0 b', discards null values
No more hacky string concatenations!
0.0.2 (January 31th 2015)
FAQs
Utility for easily manipulating the DOM class string
The npm package react-classset receives a total of 467 weekly downloads. As such, react-classset popularity was classified as not popular.
We found that react-classset demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.