Skip to content

support preserving state of children component when updating parent component #40

Open
@bloody-ux

Description

@bloody-ux

Describe the issue

When updating the code of parent component, the local state of children component is lost(with preserveLocalState: true). While the local state of parent component can be kept.

In below screenshot, the local state of Counter will reset to default when App is change. Because in svelte-hmr, when parent component is changed, it will recreate itself(can keep local state) and it's children components(without keeping local state).

image

Expected behavior

The local state of children is kept as well when updating parent component, just like react does. It's annoying when debugging between parent component and children components if the local state is lost.

And developer may think it's a bug of HMR because of the inconsistence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions