Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Serialize javascript objects as highlighted, formatted json

License

Notifications You must be signed in to change notification settings

Indoqa/react-json-syntax-highlighter

Repository files navigation

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} />
  }
}

About

Serialize javascript objects as highlighted, formatted json

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published