In this example, HelloWorld
is a functional component that renders a View
containing a Text
component displaying "Hello, World!".
In React Native, a component is a reusable piece of the user interface that can be composed together to build complex UIs.
There are two main types of components in React Native
- Functional Components
- Class Components
import React from 'react';
import { View, Text } from 'react-native';
const HelloWorld = () => {
return (
<View>
<Text>Hello, World!</Text>
</View>
);
};
export default HelloWorld;
© www.thecoderjob.com. All Rights Reserved. Designed by HTML Codex