Skip to content

Conversation

@dherault
Copy link

Add support for JsxElement.remove and JsxSelfClosingElement.remove

If anything just ask I'm around.

});

it("should remove the JsxElement child", () => {
doTestWithJsxElementChild(`var t = (<jsx><jsx2></jsx2></jsx>);`, `var t = (<jsx></jsx>);`);
Copy link
Owner

@dsherret dsherret Mar 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but it's not so simple unfortunately. Once spaces are added then it gets much more complicated because spaces have meaning in JSX. It's why I haven't had the time to add this functionality yet. For example:

it("should remove the JsxElement child when has spaces", () => {
      doTestWithJsxElementChild(
        `var t = (<jsx>
        <jsx2></jsx2>
      </jsx>);`,
        `var t = (<jsx></jsx>);`,
      );
    });

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants