Skip to content

Inline component / Flatten component #4382

@mkArtakMSFT

Description

@mkArtakMSFT

Problem Statement

Sometimes as a result of refactoring some components end up becoming very naïve - containing only a line or two of markup and nothing else. In these situations, it's useful to reduce the complexity by eliminating these components.

Feature Request

To help with eliminating these naïve components, it'll be great to have a mechanism to:

  1. automatically replace the references of this component with the markup from that component
  2. remove the component as it's not used any more

Here what it would like before and after applying the fix:

Before

Component1.razor

<div class="row">
  <Component2 />
</div>

Component2.razor

<div class="customText">
  This is some static content
</div>

After

Component1.razor

<div class="row">
  <div class="customText">
    This is some static content
  </div>
</div>

Component2.razor - Deleted

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions