Component - Custom components
This UI shows how to create and use a custom component in React Native. The custom component is a simple button that displays a label and triggers an action when pressed.
This UI shows how to create and use a custom component in React Native. The custom component is a simple button that displays a label and triggers an action when pressed.
App ├── View (container) │ ├── CustomButton │ │ └── Pressable │ │ └── Text │ └── Text (status message)
Greeting in React Native?function Welcome(props) {
return Hi, {props.name}!;
}
// Usage:
<Welcome name="Anna" />function Button() {
return (
<TouchableOpacity>
<Text>Click me</Text>
</TouchableOpacity>
)
}
export default Button;Card component that accepts a title and content as props and displays them inside styled View and Text components. Which of the following is the best way to define this component?Pass the test and this pattern moves unknown