bootstrap-v4-snippets icon indicating copy to clipboard operation
bootstrap-v4-snippets copied to clipboard

Support JSX

Open jordanbtucker opened this issue 6 years ago • 3 comments
trafficstars

jordanbtucker avatar Mar 29 '19 21:03 jordanbtucker

Hey @jordanbtucker,

In order to implement support for JavaScript React (jsx) language I'd need some testing from your side as I'm not familiar with that language and I can't validate if the snippets are compatible with it.

In visual studio code open user snippets (https://i.imgur.com/GvJU9z3.png), select jsx language and in the newly opened file paste snippets code from https://github.com/Zaczero/bootstrap-v4-snippets/blob/master/bootstrap-v4-snippets/snippets/snippets.json

Then just save the user snippets and test if everything works fine with jsx files 😃

Zaczero avatar Jun 07 '19 21:06 Zaczero

@Zaczero First off, thank you for making these snippets, they are very helpful!

For JSX compatibility there are a few issues.

  • Self closing tags cannot be left open, <br> throws errors, <br /> will not.
  • Instead of class="btn", className should be used so className="btn".
  • The for attribute should be converted to htmlFor.

I've just started using your snippets but those are the first issues I've noticed so far.

idevstuffs avatar Jan 13 '20 15:01 idevstuffs

* osing tags cannot be left

Thanks for the details, I'll implement those changes and add the JSX support in free time :-)

Zaczero avatar Jan 14 '20 15:01 Zaczero