File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ def vdom(
174
174
if event_handlers :
175
175
model ["eventHandlers" ] = event_handlers
176
176
177
- if key :
177
+ if key != "" :
178
178
model ["key" ] = key
179
179
180
180
if import_source is not None :
@@ -337,6 +337,6 @@ def _is_single_child(value: Any) -> bool:
337
337
if (isinstance (child , ComponentType ) and child .key is None ) or (
338
338
isinstance (child , Mapping ) and "key" not in child
339
339
):
340
- logger .error (f"Key not specified for dynamic child { child } " )
340
+ logger .error (f"Key not specified for child in list { child } " )
341
341
342
342
return False
Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ def test_debug_log_cannot_verify_keypath_for_genereators(caplog):
336
336
def test_debug_log_dynamic_children_must_have_keys (caplog ):
337
337
idom .vdom ("div" , [idom .vdom ("div" )])
338
338
assert len (caplog .records ) == 1
339
- assert caplog .records [0 ].message .startswith ("Key not specified for dynamic child" )
339
+ assert caplog .records [0 ].message .startswith ("Key not specified for child" )
340
340
341
341
caplog .records .clear ()
342
342
@@ -346,4 +346,4 @@ def MyComponent():
346
346
347
347
idom .vdom ("div" , [MyComponent ()])
348
348
assert len (caplog .records ) == 1
349
- assert caplog .records [0 ].message .startswith ("Key not specified for dynamic child" )
349
+ assert caplog .records [0 ].message .startswith ("Key not specified for child" )
You can’t perform that action at this time.
0 commit comments