简体   繁体   中英

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

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'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM