mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
[DevTools] Hide props section if it is null (#30696)
We use null as a marker that we don't know what the props are as opposed to knowing that they're empty.
This commit is contained in:
committed by
GitHub
parent
dd8e0ba857
commit
fca5d655d7
@@ -54,11 +54,14 @@ export default function InspectedElementPropsTree({
|
||||
type === ElementTypeClass || canEditFunctionPropsRenamePaths;
|
||||
|
||||
const entries = props != null ? Object.entries(props) : null;
|
||||
if (entries !== null) {
|
||||
entries.sort(alphaSortEntries);
|
||||
if (entries === null) {
|
||||
// Skip the section for null props.
|
||||
return null;
|
||||
}
|
||||
|
||||
const isEmpty = entries === null || entries.length === 0;
|
||||
entries.sort(alphaSortEntries);
|
||||
|
||||
const isEmpty = entries.length === 0;
|
||||
|
||||
const handleCopy = () => copy(serializeDataForCopy(((props: any): Object)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user