JSPM

react-json-syntax-highlighter

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3513
  • Score
    100M100P100Q126404F
  • License Apache-2.0

Serialize javascript objects as highlighted, formatted json

Package Exports

  • react-json-syntax-highlighter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-json-syntax-highlighter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React json syntax highlighter

This is a simple React component that serializes a JavaScript object as highlighted json string.

Getting Started

Install react component:

npm install --save react-json-syntax-highlighter

Import the component in your file:

import ReactJsonSyntaxHighlighter from 'react-json-syntax-highlighter'

Use it in your React component:

class MyComponent extends React.Component {

  render() {
    const obj = {
      stringProp: 'bar',
      numberProp: 1,
      booleanProp: true,
      nullProp: null,
      nestedProp: {
        nestedPropBar: 'bar'
      }
    }    
    return <ReactJsonSyntaxHighlighter obj={obj} />
  }
}