Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Add @babel/plugin-proposal-class-properties - with babel.config.js

$
0
0

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.


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>