vivek chaudhary
vivek chaudhary

Reputation: 57

How can I import a component from GitHub repository

what I have done so far

step 1. yarn add githubURL

step 2. "comet-chat-repo": "https://github.com/Vivek/cometChatRepo.git",

above file added in package.json

step 3. Trying to import the components from the GitHub repo

import { CometChatGroupListWithMessages } from 'comet-chat-repo';

Module not found: Can't resolve 'comet-chat-repo' in 'C:\Users

Upvotes: 0

Views: 1793

Answers (1)

Eduard
Eduard

Reputation: 535

npm install git://github.com/username/repo.git#branch-name

yarn add git://github.com/username/repo.git#branch-name

// Example
yarn add git://github.com/denvash/react-pagination-example.git#master

Then import it according to the repo path, for example:

import Pagination from 'react-pagination/src/components/Pagination.react'

Upvotes: 1

Related Questions