Create React Component in Git Repository and Import

Viewed 33

I am trying to create a React component and import it through a git URL.

My question is, how should the component be created? How should I import it?

I didn't find much information

I've been reviewing this response How can I import a component from GitHub repository

For example, i have this component

import React from "react";

function Title() {
  return (
    <div>
      <h1>Sample Importing</h1>
    </div>
  );
}

export default Title;

To migrate it to the new git repo, should I initialize the project with CRA?

How do I give the directives to then do

npm install bitbuketurl..

import Title from '....'

0 Answers
Related