
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
classnames-react-native
Advanced tools
This library resolve styles merging in react-native
Like package classNames for regular React
Step one:
npm i classnames-react-native
Step two:
Enjoy!
classnames([styleObject][, [styleObject, conditions]])
Example #1
import classNames from 'classnames-react-native'
const A = { padding: 10 }
const B = { backgroudColor: '#fff' }
const C = { margin: 10 }
classnames(A, [B, true], [C, false ])
// classNames(styleObject, [styleObject, conditions], [styleObject, conditions])
/* classNames returns this styles: */
{
padding: 10, // from object A
backgroudColor: "#fff", // from object B (conditions is positive)
// object C is ignored (because conditions is negative)
}
Example #2
import classNames from 'classnames-react-native'
import StyleGuide from '../../style/xxx'
import style from './style'
class Example extends Component {
render() {
const { wide = true, ghost = false } = this.props
const style = classNames(
StyleGuide.spacing.large,
style.root,
// or units style
[style.wide, wide],
// or union style
[
style.transparent, ghost,
style.fill, true,
],
)
/*
* classnames returns object, witch includes styles:
* - spacing
* - root
* - wide
* - fill
*/
return (
<View style={style}>
...
</View>
)
}
}
FAQs
This library resolve styles merging in react-native
The npm package classnames-react-native receives a total of 2 weekly downloads. As such, classnames-react-native popularity was classified as not popular.
We found that classnames-react-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.