This commit is contained in:
Nathan Bierema 2021-08-25 23:24:10 -04:00
parent a82d207f4c
commit 5c2e24638a

View File

@ -7,21 +7,21 @@ React JSON Viewer Component, Extracted from [redux-devtools](https://github.com/
### Usage ### Usage
```jsx ```jsx
import JSONTree from 'react-json-tree' import JSONTree from 'react-json-tree';
// If you're using Immutable.js: `npm i --save immutable` // If you're using Immutable.js: `npm i --save immutable`
import { Map } from 'immutable' import { Map } from 'immutable';
// Inside a React component: // Inside a React component:
const json = { const json = {
array: [1, 2, 3], array: [1, 2, 3],
bool: true, bool: true,
object: { object: {
foo: 'bar' foo: 'bar',
}, },
immutable: Map({ key: 'value' }) immutable: Map({ key: 'value' }),
} };
<JSONTree data={json} /> <JSONTree data={json} />;
``` ```
#### Result: #### Result: