Deft
Ask AI

Search

Search skills, authors and topics

vercel-labs / agent-skills

vercel-react-native-skills

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

Install

npx skills add https://github.com/vercel-labs/agent-skills --skill vercel-react-native-skills
title
Wrap Strings in Text Components
impact
CRITICAL
impactDescription
prevents runtime crash
tags
rendering, text, core

Wrap Strings in Text Components

Strings must be rendered inside <Text>. React Native crashes if a string is a direct child of <View>.

Incorrect (crashes):

tsx
import { View } from 'react-native'
function Greeting({ name }: { name: string }) {  return <View>Hello, {name}!</View>}// Error: Text strings must be rendered within a <Text> component.

Correct:

tsx
import { View, Text } from 'react-native'
function Greeting({ name }: { name: string }) {  return (    <View>      <Text>Hello, {name}!</Text>    </View>  )}