Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions packages/react-devtools-shared/src/backend/fiber/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6859,6 +6859,8 @@ export function attach(

// TODO Show custom UI for Cache like we do for Suspense
// For now, just hide state data entirely since it's not meant to be inspected.
// Make sure delete, rename, and override of state handles all tags for which
// we show state.
const showState =
tag === ClassComponent || tag === IncompleteClassComponent;

Expand Down Expand Up @@ -7815,8 +7817,13 @@ export function attach(
}
break;
case 'state':
deletePathInObject(instance.state, path);
instance.forceUpdate();
switch (fiber.tag) {
case ClassComponent:
case IncompleteClassComponent:
deletePathInObject(instance.state, path);
instance.forceUpdate();
break;
}
break;
}
}
Expand Down Expand Up @@ -7893,8 +7900,13 @@ export function attach(
}
break;
case 'state':
renamePathInObject(instance.state, oldPath, newPath);
instance.forceUpdate();
switch (fiber.tag) {
case ClassComponent:
case IncompleteClassComponent:
renamePathInObject(instance.state, oldPath, newPath);
instance.forceUpdate();
break;
}
break;
}
}
Expand Down Expand Up @@ -7964,6 +7976,7 @@ export function attach(
case 'state':
switch (fiber.tag) {
case ClassComponent:
case IncompleteClassComponent:
setInObject(instance.state, path, value);
instance.forceUpdate();
break;
Expand Down
Loading