Component - First React Native app
This is the simplest React Native app that shows a greeting message and a button. When you tap the button, the message changes. It teaches how to create a basic app with text and interaction.
This is the simplest React Native app that shows a greeting message and a button. When you tap the button, the message changes. It teaches how to create a basic app with text and interaction.
App (Functional Component)
└── View (container)
├── Text (greeting message)
└── Button (pressable button)View component in a React Native app?ViewView component is like a box that holds other components and helps arrange them on the screen.Text displays text, but View is for layout and grouping.View = container [OK]View with TextView handles user inputView fetches dataimport React from 'react'; is correct.View and Text are named exports from 'react-native', so import { View, Text } from 'react-native'; is correct.import React from 'react';
import { View, Text } from 'react-native';
export default function App() {
return (
Hello, React Native!
);
}App function returns a View containing a Text component with the string 'Hello, React Native!'.Text component on the screen inside the View.import React from 'react';
import { View, Text } from 'react-native';
export default function App() {
return (
Hello World
)
}View does not require a style prop to work. Semicolons are optional in JavaScript.View component to achieve this?flex: 1 and use justifyContent: 'center' for vertical centering and alignItems: 'center' for horizontal centering.Pass the test and this pattern moves unknown