In React Native, props (short for "properties") are used to pass data from a parent component to a child component. Props allow you to customize the behavior and appearance of your components.
const Greeting = (props) => {
return (
<View>
<Text>Hello, {props.firstName} {props.lastName}!</Text>
</View>
);
};
const App = () => {
const person = {
firstName: 'John',
lastName: 'Doe',
};
return (
<Greeting {...person} />
);
};
© www.thecoderjob.com. All Rights Reserved. Designed by HTML Codex