# rendering-no-falsy-and

rendering-no-falsy-and is a Claude Code rule that guards against unsafe conditional JSX rendering. It targets cases where a value may be an empty string or zero.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 88 repo stars
- Author: alexj11324
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/alexj11324/Mikka/tree/HEAD/.claude/skills/react-native-skills/rules/rendering-no-falsy-and.md
- Updated: 2026-11-17
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/rendering-no-falsy-and

## What it does

The rule flags JSX conditions such as `value && <Component />` when the value can be an empty string or `0`. React Native may render that falsy value as text outside a `<Text>` component, causing the app to crash.

It recommends a ternary that returns `null`, an explicit boolean check with `!!`, or an early return. The rule describes early returns as the clearest option. The `react/jsx-no-leaked-render` rule from `eslint-plugin-react` can also catch this pattern automatically.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/rendering-no-falsy-and.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/rendering-no-falsy-and.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/rendering-no-falsy-and.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/rendering-no-falsy-and.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/rendering-no-falsy-and.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/alexj11324/Mikka/tree/HEAD/.claude/skills/react-native-skills/rules/rendering-no-falsy-and.md

## When to use it
- avoid rendering an empty string outside `<Text>`
- prevent a crash when a JSX condition evaluates to zero
- replace unsafe `value && <Component />` checks

## Example prompts
- Check this component for JSX conditions that could render an empty string or zero.
- Replace unsafe `&&` rendering checks in this React Native code.

## Similar
- [rendering-conditional-render](https://affpapa.org/en/nevibecode/rules/rendering-conditional-render.md) — rule · ★ 7191 repo stars
- [rendering-hoist-jsx](https://affpapa.org/en/nevibecode/rules/rendering-hoist-jsx.md) — rule · ★ 7191 repo stars
- [rendering-activity](https://affpapa.org/en/nevibecode/rules/rendering-activity.md) — rule · ★ 1064 repo stars
- [pixijs-rendering](https://affpapa.org/en/nevibecode/skills/pixijs-rendering.md) — skill · 10800 installs
- [rendering-content-visibility](https://affpapa.org/en/nevibecode/rules/rendering-content-visibility.md) — rule · ★ 1064 repo stars
- [blender-rendering](https://affpapa.org/en/nevibecode/skills/blender-rendering.md) — skill · 2400 installs

From the same set: [alexj11324/mikka](https://affpapa.org/en/nevibecode/by/alexj11324/mikka.md) — 47 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
