Skip to content

Commit 6864696

Browse files
Added prop for resetEntries.
1 parent c4ad679 commit 6864696

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/react-devtools-shared/src/devtools/views/Components/InspectedElementTree.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ type Props = {|
2828
overrideValueFn?: ?OverrideValueFn,
2929
showWhenEmpty?: boolean,
3030
canAddEntries?: boolean,
31+
canResetEntries?: boolean,
3132
|};
3233

3334
export default function InspectedElementTree({
3435
data,
3536
inspectPath,
3637
label,
3738
overrideValueFn,
38-
canAddEntries = false,
3939
showWhenEmpty = false,
40+
canAddEntries = false,
41+
canResetEntries = false,
4042
}: Props) {
4143
const [entries, setEntries] = useState(null);
4244
const [entryToAdd, setEntryToAdd] = useState(null);
@@ -115,7 +117,7 @@ export default function InspectedElementTree({
115117
<ButtonIcon type="add" />
116118
</Button>
117119
)}
118-
{canAddEntries && (
120+
{canResetEntries && (
119121
<Button onClick={handleResetEntries} title={`Reset ${label}`}>
120122
<ButtonIcon type="undo" />
121123
</Button>

packages/react-devtools-shared/src/devtools/views/Components/SelectedElement.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ function InspectedElementView({
358358
overrideValueFn={overridePropsFn}
359359
showWhenEmpty={true}
360360
canAddEntries={true}
361+
canResetEntries={true}
361362
/>
362363
{type === ElementTypeSuspense ? (
363364
<InspectedElementTree

0 commit comments

Comments
 (0)