Recall & Review
beginner
What are props in React Native?
Props are inputs to React components. They are used to pass data from a parent component to a child component, like giving instructions or information.
Click to reveal answer
beginner
How do you pass a prop named
title with value "Hello" to a component Greeting?You write:
<Greeting title="Hello" />. This sends the string "Hello" as the prop named title to the Greeting component.Click to reveal answer
beginner
How does a child component access props in React Native?
The child component receives props as a function argument. For example: <code>function Greeting(props) { return <Text>{props.title}</Text>; }</code>Click to reveal answer
intermediate
Can props be changed inside the child component?
No, props are read-only. The child component should not modify props. If you want to change data, use state or pass new props from the parent.
Click to reveal answer
beginner
Why is props passing important in React Native?
Props allow components to be reusable and dynamic by letting parents send different data to children. This helps build flexible and organized apps.
Click to reveal answer
How do you pass a number prop named
count with value 5 to a component Counter?✗ Incorrect
Numbers must be passed inside curly braces in JSX. So
count={5} passes the number 5, not a string.Where do props come from in a React Native app?
✗ Incorrect
Props are passed down from parent components to child components to share data.
Which of these is the correct way to access a prop named
name inside a functional component?✗ Incorrect
In functional components, props are received as a parameter and accessed with
props.name.Can a child component modify the props it receives?
✗ Incorrect
Props are read-only and should never be changed by the child component.
What happens if you pass no props to a component expecting some?
✗ Incorrect
If no props are passed, the component may use default props or get undefined values, depending on how it is coded.
Explain how props are passed and used in React Native components.
Think about how you tell a friend what to do and how they listen.
You got /4 concepts.
Describe why props passing helps make React Native apps reusable and organized.
Imagine giving different instructions to the same toy to make it do different things.
You got /4 concepts.