Components
Components are the building blocks of React Native apps. A component is a JavaScript function that returns JSX describing what should appear on screen.Function Components
JSX Syntax
JSX lets you write markup inside JavaScript. In React Native, you use components like<View> and <Text> instead of HTML elements:
Props
Props (properties) let you pass data from parent to child components. Props are read-only and cannot be modified by the child.Destructuring Props
Common pattern for cleaner code:State
State is data that changes over time. When state changes, React re-renders the component.useState Hook
Multiple State Variables
State updates are asynchronous. Don’t rely on the previous state value immediately after calling the setter.
Hooks
Hooks let you use state and other React features in function components.useEffect Hook
Run side effects after rendering:useEffect Cleanup
Common Hooks
- useState
- useEffect
- useRef
- useCallback
Conditional Rendering
Render different content based on conditions:Logical && Operator
Rendering Lists
Usemap() to render arrays of data:
Component Composition
Build complex UIs by combining smaller components:React Native-Specific Considerations
No HTML Elements
StyleSheet API
Event Handlers
Next Steps
Handling Text Input
Learn to work with forms and user input
Using Lists
Render large lists efficiently with FlatList