Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are these steps necessary? #712

Open
ajikan opened this issue Feb 16, 2023 · 0 comments
Open

Are these steps necessary? #712

ajikan opened this issue Feb 16, 2023 · 0 comments

Comments

@ajikan
Copy link

ajikan commented Feb 16, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant