Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-conditional-component
Advanced tools
Readme
This component displays its children only if they satisfy their predicate:
<Conditional value={someValue}>
<span showIfEquals={10}>The value is 10 or "10"</span>
<span showIfStrictlyEquals={10}>The value is 10</span>
<span showIfLte={10}>The value is lower than or equal to 10</span>
...
</Conditional>
bower install react-conditional-component
or
npm install react-conditional-component
Simply require it to use it:
var Conditional = require('react-conditional-component');
/**
* @jsx React.DOM
*/
var Demo = React.createClass({
getInitialState: function() {
return {someValue: 10};
},
componentDidMount: function() {
// Change the value after 1 second
setTimeout(function() {
this.setState({value: 0});
}.bind(this), 1000);
},
render: function() {
return (
<Conditional value={this.state.someValue}>
<span showIfEquals={10}>The value is 10 or "10"</span>
<span showIfStrictlyEquals={10}>The value is 10</span>
<span showIfLte={10}>The value is lower than or equal to 10</span>
<span showIfTrue>The value is true</span>
<span showIfTruthy>The value is truthy</span>
</Conditional>
);
}
});
React.renderComponent(<Demo/>, document.body);
The available predicates are: showIfDefined
,showIfUndefined
,showIfTrue
,showIfTruthy
,showIfFalse
,showIfFalsy
,showIfEquals
,showIfStrictlyEquals
,showIfLte
,showIfLt
,showIfGte
,showIfGt
.
MIT.
FAQs
This component displays its children only if they satisfy their predicate
The npm package react-conditional-component receives a total of 0 weekly downloads. As such, react-conditional-component popularity was classified as not popular.
We found that react-conditional-component 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.