Back to skills
SKILL.md
Rendering Conditional Render
ASecurityImported skill rendering_conditional_render from vercel
- 3 stars
- 0 votes
- 0 copies
- 3 views
- Added September 11, 2026
Security analysis
100/100npx -y skills add bitwikiorg/skills.md --skill rendering_conditional_render --agent claude-codeAre you the author of Rendering Conditional Render?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/bitwikiorg-rendering-conditional-render)---
description: Imported skill rendering_conditional_render from vercel
name: rendering_conditional_render
signature: 2ec2fa23c4148285144687050c52369adba3da2fbe3d486f8d3e0aad8f06f2bc
source: /a0/tmp/skills_research/vercel/skills/react-best-practices/rules/rendering-conditional-render.md
---
---
title: Use Explicit Conditional Rendering
impact: LOW
impactDescription: prevents rendering 0 or NaN
tags: rendering, conditional, jsx, falsy-values
---
## Use Explicit Conditional Rendering
Use explicit ternary operators (`? :`) instead of `&&` for conditional rendering when the condition can be `0`, `NaN`, or other falsy values that render.
**Incorrect (renders "0" when count is 0):**
```tsx
function Badge({ count }: { count: number }) {
return (
<div>
{count && <span className="badge">{count}</span>}
</div>
)
}
// When count = 0, renders: <div>0</div>
// When count = 5, renders: <div><span class="badge">5</span></div>
```
**Correct (renders nothing when count is 0):**
```tsx
function Badge({ count }: { count: number }) {
return (
<div>
{count > 0 ? <span className="badge">{count}</span> : null}
</div>
)
}
// When count = 0, renders: <div></div>
// When count = 5, renders: <div><span class="badge">5</span></div>
```
Attribution
Comments
Loading comments…