rendering-text-in-text-component — Claude Code rule
rendering-text-in-text-component is a Claude Code rule that enforces wrapping strings in React Native Text elements. It prevents runtime crashes in mobile interfaces.
AGPL-3.0 ★ 88 updated 2026-11-17
.claude/rules/rendering-text-in-text-component.mdWhat rendering-text-in-text-component does
The rule requires placing all text strings inside <Text> components. Rendering raw strings as direct children of <View> crashes React Native applications immediately at runtime.
When writing JSX or TSX code, the assistant checks layout containers. Any text literal or interpolation inside a <View> is wrapped in <Text> to prevent runtime errors.
What it helps with
- prevent runtime crashes from raw text in View
- wrap string variables and literals in Text components
- enforce valid React Native layout structure
Example prompts for the agent
- Build a user greeting card in React Native
- Create a profile screen with dynamic username display
- Review this TSX layout for text rendering issues
How to install rendering-text-in-text-component
Manually: put the files in place
.claude/rules/rendering-text-in-text-component.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/rendering-text-in-text-component.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/rendering-text-in-text-component.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/rendering-text-in-text-component.mdManually: put the files in place
.clinerules/rendering-text-in-text-component.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about rendering-text-in-text-component
How to install rendering-text-in-text-component in Claude Code?
Add the rule file at .claude/rules/rendering-text-in-text-component.md in your project.
What does rendering-text-in-text-component do?
It ensures text strings are placed inside <Text> components instead of directly in <View>, preventing fatal runtime crashes.
Why does React Native crash on raw text?
React Native does not allow unescaped strings directly inside <View> containers and halts execution with an error.