Components
Now here is an interesting problem; we have come across this great framework for making fast differences between the Virtual DOM and its native components. How do we tell React Native what UI to represent or when to change it? A React Native component is a simple, reusable, function-like object that enables us to describe the native mobile components we want to render. They will always contain properties, state, and a render method. Let's start really simple by creating our own component.
Creating your first component
Creating a new component in React Native will look similar to the following:
import React, { Text, View } from 'react-native'; class HelloComponent extends React.Component { render () { return ( <View> <Text>Hello React</Text> <View> ); } }
Tip
Remember to import the React Native module. Here, we are using the ES6 import statement; it is similar to how the node require module works.
Wait a second… What are these weird...