Component

Define a Component by declaring a function that returns a React Element.

You can use the named function.

function ArticleTitle() {
return <Text>React Native Design Patterns</Text>;
}

Or the arrow function

const ArticleTitle = () => {
return <Text>React Native Design Patterns</Text>;
}

Usage

To call the component on your React Native application, use the following code (Note that we need to wrap our component in a View):

import { View } from "react-native";

function App() {
return (
<View>
<ArticleTitle />
</View>
)
};

export default App;
Subscribe?

Be the first to receive insightful articles and actionable resources that help you to elevate your skills.