GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - suedar/react-code-differ: react 的代码差异查看组件,支持本地与 github 两种方法实现

BranchesTags
Open more actions menu

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
.codesandbox
.codesandbox
 
 
.storybook
.storybook
 
 
public
public
 
 
scripts
scripts
 
 
src
src
 
 
.env
.env
 
 
.eslintcache
.eslintcache
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
package.json
package.json
 
 
rollup.config.js
rollup.config.js
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

react-code-differ

本组件可用于代码差异的查看, 由于是 react 编写的,仅支持 react 版本

组件文档地址

先支持两种使用方式:

  1. 本地文件引入
  2. github 线上 diff 地址引入

安装

npm i react-code-differ

本地文件引入

import { CodeDiff } from "react-code-differ";
import diffText from './diffText'

export const MyComponent = (args) => {
  return (
    <CodeDiff type={"local"} path={diffText} />
  );
};

github 线上 diff 地址引入

import { CodeDiff } from "react-code-differ";

export const MyComponent = (args) => {
  const path = "https://api.github.com/repos/rtfpessoa/diff2html/pulls/106"
  return (
    <CodeDiff type={"github"} path={path} />
  );
};

About

react 的代码差异查看组件,支持本地与 github 两种方法实现

63c4ee8240b12d9fbe70f43c-vvmeeybrzf.chromatic.com/?path=/docs/react-code-differ--%E6%9C%AC%E5%9C%B0%E6%96%87%E4%BB%B6%E5%BC%95%E5%85%A5

Topics

code-diffdiffdiff2htmljavascriptreact

Resources

Readme
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.