I'm looking at the React docs for this library and wondering if the "Babel Usage" steps are even necessary:
Cleave.js uses ES6 spread / rest feature, and we recommend using Babel compiler to transfer ES6 code.
However, if for some reason you would like to just refer to the final bundled script, check the [legacy way](https://github.com/nosir/cleave.js/blob/master/doc/reactjs-component-usage.md#legacy-way).
First, install babel presets:
npm install --save babel-preset-es2015 babel-preset-react
For Webpack, also do:
npm install --save babel-core babel-loader
After that, add .babelrc to your project root with:
{
"presets": ["es2015", "react"]
}
I was able to use Cleave.js successfully in my react project with just "npm install --save cleave.js". I'm using React 17.
I'm looking at the React docs for this library and wondering if the "Babel Usage" steps are even necessary:
I was able to use Cleave.js successfully in my react project with just "npm install --save cleave.js". I'm using React 17.