J
J
javanub2018-09-15 17:26:11
Pug
javanub, 2018-09-15 17:26:11

I want to install the babel-plugin-transform-react-pug package to use Pug instead of JSX in React, but it doesn't work, why?

I want to use Pug instead of JSX, I put babel-plugin-transform-react-pug package . It seems that I did everything according to the instructions, but writes: 'pug' is not defined react:

const App = ({}) => pug`
      h1 Hello
`;
export default App;

Did:
1. npm install --save-dev babel-plugin-transform-react-pug
2. Created .babelrc and added:
{
"plugins": [
"transform-react-pug",
"transform-react-jsx"
]
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question