Skip to content

Commit

Permalink
Added prop for resetEntries.
Browse files Browse the repository at this point in the history
  • Loading branch information
hristo-kanchev committed Sep 10, 2019
1 parent c4ad679 commit 6864696
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ type Props = {|
overrideValueFn?: ?OverrideValueFn,
showWhenEmpty?: boolean,
canAddEntries?: boolean,
canResetEntries?: boolean,
|};

export default function InspectedElementTree({
data,
inspectPath,
label,
overrideValueFn,
canAddEntries = false,
showWhenEmpty = false,
canAddEntries = false,
canResetEntries = false,
}: Props) {
const [entries, setEntries] = useState(null);
const [entryToAdd, setEntryToAdd] = useState(null);
Expand Down Expand Up @@ -115,7 +117,7 @@ export default function InspectedElementTree({
<ButtonIcon type="add" />
</Button>
)}
{canAddEntries && (
{canResetEntries && (
<Button onClick={handleResetEntries} title={`Reset ${label}`}>
<ButtonIcon type="undo" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ function InspectedElementView({
overrideValueFn={overridePropsFn}
showWhenEmpty={true}
canAddEntries={true}
canResetEntries={true}
/>
{type === ElementTypeSuspense ? (
<InspectedElementTree
Expand Down

0 comments on commit 6864696

Please sign in to comment.