Current Situation
If two children obtain their key from a parent, both children's use_state are wiped if either child changes key.
fromidomimportcomponent, html, run, hooks@componentdefParent():
state, set_state=hooks.use_state(1)
returnhtml.div(
html.button({"onClick": lambdaevent: set_state(state+1)}, "click me"),
Child("key-0"),
Child(f"key-{state}"),
)
@componentdefChild(child_key):
state, set_state=hooks.use_state(0)
@hooks.use_effectasyncdefwhatever():
ifstate:
returnprint(f"Child {child_key!r} has no state")
set_state(1)
returnhtml.div(
child_key,
key=child_key,
)
run(Parent)Proposed Actions
Investigate and resolve this parent-child key abnormality
Work Items
See above
Current Situation
If two children obtain their
keyfrom a parent, both children'suse_stateare wiped if either child changeskey.Proposed Actions
Investigate and resolve this parent-child key abnormality
Work Items
See above