0.12.2 • Published 7 years ago

@datns/render-json v0.12.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

@datns/render-json

React component for displaying javascript arrays and JSON objects.

Usage

import RenderJSON from '@datns/render-json'
// If you're using Immutable.js: `npm i --save immutable`
import { Map } from 'immutable'

// Inside a React component:
const json = {
  array: [1, 2, 3],
  bool: true,
  number: 12,
  fnctn: function() {},
  object: {
    foo: 'bar'
  },
  immutable: Map({ key: 'value' })
}

<RenderJSON data={json} />

Available Properties

required:

  • data: array or object

optional:

  • collapseStringsAfterLength: number after which strings are supposed to be cut off
  • theme: 'dark'

Setup

yarn

Build

yarn build

License

@datns/renderJSON is MIT licensed.