1.0.1 • Published 3 years ago

react-json-compare-viewer v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

A SIMPLE REACT COMPONENT WHICH CAN COMPARE TWO JSON VISUALLY

it is easy for you to use this component to show the differece of two json

u can customize the styles by cover the css class

demo

USAGE

  1. install

yarn add react-json-compare-viewer"

  1. quote

import JsonFormat from 'react-json-compare-viewer'

  1. use

<div>{ JsonFormat( {a: 1}, {a: 2} ) }</div>

ATTENTION

if u r use webpack5, u may encounter an error which say process is not defined.

because webpack5 do not include polyfills for nodejs

u can try add the following code to webpack config after yarn add process

...
plugins: [
    ...
    new webpack.ProvidePlugin({
      process: 'process/browser',
    }),
    ...
]