Skip to content

[Feature Request]: option to forceRemount on some arg changes #22359

Open

Description

Is your feature request related to a problem? Please describe

Sometime a prop is only important during the first render of a component. That is usually the case for web-components with server side rendered markup, but even for client side rendering, assume a component with a lazy prop that depending on it being true or false, it would download some data or render some markup. Then changing the lazy prop from false to true on an already rendered component, and previously in eager mode doesn't make sense. It would be helpful to remount the whole component when this arg changes.

Describe the solution you'd like

It can be part of the argTypes. e.g.

{
  argTypes: {
    someArg: {
      forceRemount: true,
      // ...
    }
  }
}

or even part of the meta config for the whole story if a remount is necessary for any arg change.

Describe alternatives you've considered

this might be related to #21706

Are you able to assist to bring the feature to reality?

yes, I can

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions