components work without 'key' attribute set

This commit is contained in:
Andreas Rumpf 2017-07-12 13:23:58 +02:00
commit e94071b077
2 changed files with 4 additions and 4 deletions

View file

@ -228,9 +228,9 @@ proc eq(a, b: VNode): EqResult =
if a.text != b.text:
when defined(profileKarax): inc reasons[deComponent]
return different
if VComponent(a).key.isNil and VComponent(b).key.isNil:
when defined(profileKarax): inc reasons[deComponent]
return different
#if VComponent(a).key.isNil and VComponent(b).key.isNil:
# when defined(profileKarax): inc reasons[deComponent]
# return different
if VComponent(a).key != VComponent(b).key:
when defined(profileKarax): inc reasons[deComponent]
return different

View file

@ -54,7 +54,7 @@ proc newTextInput*(style: VStyle = VStyle(); key: cstring;
result = newComponent(TextInput, render, changed=changed, updated=update)
result.style = style
result.value = value
result.key = key
#result.key = key
when false:
type