naomi icon indicating copy to clipboard operation
naomi copied to clipboard

JSX arrow function prop produces a closing tag

Open aprilmintacpineda opened this issue 4 years ago • 2 comments

Enter in the following code:

<TestComponent onDone={() = } />

Notice that I intentionally left out arrow function like that, now you know what's next there right? The moment you type in the next character in the arrow function which is >, you'll get:

<TestComponent onDone={() =></div>} />

The same thing also happens with these:

<TestComponent onDone={() =}
<TestComponent
  test={() =}
/>

These works as expected:

<TestComponent onDone={() =
<TestComponent
  test={() =
/>

aprilmintacpineda avatar Jan 06 '20 09:01 aprilmintacpineda

agreed this is super annoying, I did file a bug about this but nobody's gotten around to it

neaumusic avatar Jan 08 '20 22:01 neaumusic

Not necessarily a fix, but you can disable this behavior by adding:

"auto_close_tags": false

To your "Settings - Syntax Specific" json file.

danro avatar May 10 '20 21:05 danro