-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
We often need to add spacing between two elements in JSX. For example:
<GenericTextComponent type='test' />
<span>{' '}</span>
<GenericTextComponent type='other' />Applying --fix turns the code into this:
<GenericTextComponent type='test' />
<span />
<GenericTextComponent type='other' />which is not the same thing.
I think I've traced down what's happening. The code above gives off this error:
error Curly braces are unnecessary here react/jsx-curly-brace-presence
Which, when corrected (by removing the curly braces and quotes), gives off another error:
error Empty components are self-closing react/self-closing-comp
which --fix happily turns into the <span /> above.
Versions:
sharmilajesupaul, pascalduez, jfo84 and mkataja