
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
babel-plugin-jsx-cases-control
Advanced tools
A babel plugin extending the JSX syntax with easy to use conditional statement
A babel plugin extending the JSX syntax with easy to use conditional statement
<div if={this.div.will.only.exist.if.this.statement.is.true}>
{console.log('This will not even execute when the condition evaluates false')}
</div>
<Cases>
<div if={first.condition}>
This is shown if the first condition matches
</div>
<div if={second.condition}>
This is shown if the first condition fail to match but second condition matches
</div>
<div>
This is shown when all above condition doesn't match
</div>
<div>
This is never shown
</div>
</Cases>
<Cases of={the.number}>
<div if={0}>
the number is 0
</div>
<div if={1}>
the number is 1
</div>
<div if="hello">
the number is actually a string
</div>
<div>
the number is nothing above
</div>
<div>
This is never shown
</div>
</Cases>
The Cases
tag is converted to something like {condition ? consequent : alternate}
so you can not set key
or ref
on this.
Just set properties on the branch tags instead.
You may set if
on the Cases
tag too.
FAQs
A babel plugin extending the JSX syntax with easy to use conditional statement
The npm package babel-plugin-jsx-cases-control receives a total of 1 weekly downloads. As such, babel-plugin-jsx-cases-control popularity was classified as not popular.
We found that babel-plugin-jsx-cases-control 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
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.