mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-26 07:59:48 +03:00
Prettify
This commit is contained in:
parent
a82d207f4c
commit
5c2e24638a
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user