Skip to content

Commit 342b474

Browse files
committed
reduce log spam from missing keys in children
1 parent 03db150 commit 342b474

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/idom/core/vdom.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,11 @@ def _is_single_child(value: Any) -> bool:
329329
)
330330
else:
331331
for child in value:
332-
if (isinstance(child, ComponentType) and child.key is None) or (
333-
isinstance(child, Mapping) and "key" not in child
334-
):
332+
if isinstance(child, ComponentType) and child.key is None:
335333
logger.error(f"Key not specified for child in list {child}")
334+
elif isinstance(child, Mapping) and "key" not in child:
335+
# remove 'children' to reduce log spam
336+
child_copy = {**child, "children": ...}
337+
logger.error(f"Key not specified for child in list {child_copy}")
336338

337339
return False

0 commit comments

Comments
 (0)