nosir / cleave.js

Format input text content when you are typing...
http://nosir.github.io/cleave.js
Apache License 2.0
17.95k stars 1.62k forks source link

Are these steps necessary? #712

Open ajikan opened 1 year ago

ajikan commented 1 year ago

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.