Reputation: 3
i see teacher in a tutorial of Reactjs he type : nav.navbar
and magically <nav className="navbar"></nav>
appear. Can some one help me to explain it and how to do this. Thanks a lot
Upvotes: 0
Views: 183
Reputation: 370679
That is emmet notation.
At the basics, it will transform a selector: nav.navbar
into the HTML (well, JSX) markup equivalent matching that selector: an element with a nav
tag name with a class name of navbar
.
How to do this will depend on your IDE. For VSCode, for example:
- Go to Code (at the top of your screen), then Preferences, then Settings in VSCode
- In the options on the left, select Extensions, then Emmet
- Scroll to the Include Languages section, add in the item input, javascript and in the value input, javascriptreact and hit Add Item
Upvotes: 2