react export

JavaScript
import React, { Component } from 'react';import React from 'react';
import {Text} from 'react-native';

export default function Cat() {
  return (
    <Text>Hello, I am your cat!</Text>
  );
}//Export single component in react.js
import React from "react";

function MyInfo() {
    return (
      <div>
        <h1>Swapnil</h1>
        <p>Hy this is Swapnil, I have no idea who I am</p>
        <ul>
          <li>Ladakh</li>
          <li>Himachal Pradesh</li>
          <li>Vellangiri Mountains</li>
        </ul>
      </div>
    )
  }

export default MyInfo
Source

Also in JavaScript: