naomi
naomi copied to clipboard
JSX arrow function prop produces a closing tag
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={() =
/>
agreed this is super annoying, I did file a bug about this but nobody's gotten around to it
Not necessarily a fix, but you can disable this behavior by adding:
"auto_close_tags": false
To your "Settings - Syntax Specific" json file.