Configuring
Assuming that you already have your ES6 environment configured with babel (if you dont know how to configure a babel environment, you can download our NevinhaJS Boirlaplate ⬆), you just need to add in your package.json the nevinhajs through the command:
yarn add nevinha-js
if you don't have yarn, you can use the npm command:
npm install nevinha-js
We use JSX syntaxe by default, so you'll need to add the transform-react-jsx
babel plugin to convert the JSX to javascript:
yarn add -D babel-plugin-transform-react-jsx
After that in your .babelrc file, you have to put the follow lines:
"plugins": [
[
"transform-react-jsx",
{ "pragma": "NevinhaDOM" }
]
]
What's next?
Now you know how to setup NevinhaJs in your project, let's see how to create our first component.