New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-code-differ

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-code-differ

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

latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

react-code-differ

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

组件文档地址

先支持两种使用方式:

  • 本地文件引入
  • 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} />
  );
};

Keywords

react

FAQs

Package last updated on 17 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts