how to create a component in react native

JavaScript
class Car extends React.Component {
  render() {
    return <h2>Hi, I am a Car!</h2>;
  }
}
Source

Also in JavaScript: