Closed pedro757 closed 1 year ago
Came to post something similar. When changing <>
into <React.Fragment>
nvim-ts-autotag added a closing </React.Fragment>
, but it was in the wrong place in the markup, and it also replaced a tag that it shouldn't have.
It's hard to give a specific example, as it happened to me with a very deeply nested code, but here is a contrived example that is at least similar.
<React.Fragemtn>
<Card>
<CardBody>
{status === 'CLOSED' ? (
<summary>
{
summary.filter((s) => s.month_end === date)
.map((h, i) => {
if (i === 0) {
return (
<> // <---- change this to React.Fragment
<div>{h.modified_at} {translateStatus(h.status)}</div>
<div>View status history</div>
</>
);
}
});
}
</summary>
) : (
<summary>
{
// more stuff
}
</summary>
)}
</CardBody>
</Card> // <---- This tag was transformed into a React.Fragment closing tag
</React.Fragemtn>
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I hate stale bot. This needs to re-opened if it's solvable.
In react we use fragments, which is basically just an empty tag like this:
If i try to chage that empty tag this plugin does nothing.
It works well with non-empty tags.