I am trying to use ConfirmGoogleCaptcha in a React Native app, after installing it I get the following error:
class ConfirmGoogleCaptcha extends Component {
state = {
^
show: false
}
show = () => {
Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.
Most of the answers that I've read suggest adding presets and plugins into .babelrc
file, that did not work for me. Also many answers and the documentation say that babel.config.js
can solve the problem, here is my babel.config.js file:
module.exports = function (api) {
api.cache(true);
return {
presets: ['module:metro-react-native-babel-preset', '@babel/preset-env', '@babel/preset-react'],
plugins: ['@babel/plugin-proposal-class-properties', {loose: true}],
};
};
I only want to solve this using babel.config.js
file.