You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To use react-pug, you just declare a tagged template literal:
importReactfrom'react';importReactDOMfrom'react-dom';functionHomePage(){returnpug` div h1 Home Page p Some content `;}ReactDOM.render(pug`HomePage`,document.getElementById('container'),);
babel-plugin-transform-react-pug will convert the pug code in template literals into JSX.
Editor Support
In brackets you just install the pug plugin. In atom, install language-babel and the pug plugin, then configure the template literal tag in langauge-pug (this needs documenting properly).
The text was updated successfully, but these errors were encountered:
This page should look along the lines of:
react-pug
You can use pug to generate react templates. This is supported via a babel-plugin. To use it, you need the following two plugins in your
.babelrc
:You can install them via:
Usage
To use react-pug, you just declare a tagged template literal:
babel-plugin-transform-react-pug
will convert the pug code in template literals into JSX.Editor Support
In brackets you just install the pug plugin. In atom, install language-babel and the pug plugin, then configure the template literal tag in langauge-pug (this needs documenting properly).
The text was updated successfully, but these errors were encountered: