mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
[react-json-tree] Add keyPath to getItemString args
This commit is contained in:
parent
03d1448dc3
commit
0075e74ff2
|
@ -102,14 +102,14 @@ You can pass `getItemString` to customize the way arrays, objects, and iterable
|
||||||
By default, it'll be:
|
By default, it'll be:
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
<JSONTree getItemString={(type, data, itemType, itemString)
|
<JSONTree getItemString={(type, data, itemType, itemString, keyPath)
|
||||||
=> <span>{itemType} {itemString}</span>}
|
=> <span>{itemType} {itemString}</span>}
|
||||||
```
|
```
|
||||||
|
|
||||||
But if you pass the following:
|
But if you pass the following:
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
const getItemString = (type, data, itemType, itemString)
|
const getItemString = (type, data, itemType, itemString, keyPath)
|
||||||
=> (<span> // {type}</span>);
|
=> (<span> // {type}</span>);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,8 @@ export default class JSONNestedNode extends React.Component {
|
||||||
nodeType,
|
nodeType,
|
||||||
data,
|
data,
|
||||||
itemType,
|
itemType,
|
||||||
createItemString(data, collectionLimit)
|
createItemString(data, collectionLimit),
|
||||||
|
keyPath
|
||||||
);
|
);
|
||||||
const stylingArgs = [keyPath, nodeType, expanded, expandable];
|
const stylingArgs = [keyPath, nodeType, expanded, expandable];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user