admin管理员组

文章数量:1401193

I want to integrate the QR code scanner feature in my react-native-based applications.

so I am installing the react-native-vision-camera package.

According to documentation, I have to add globals __scanQRCodes inside babel.config.js

globals: ['__scanQRCodes']

But after adding globals __scanQRCodes inside babel.config.js. I got BABEL TRANSFORM ERROR .globals is not a valid Plugin property

I want to integrate the QR code scanner feature in my react-native-based applications.

so I am installing the react-native-vision-camera package.

According to documentation, I have to add globals __scanQRCodes inside babel.config.js

globals: ['__scanQRCodes']

But after adding globals __scanQRCodes inside babel.config.js. I got BABEL TRANSFORM ERROR .globals is not a valid Plugin property

Share Improve this question asked Mar 23, 2022 at 12:12 Binit Chandra JhaBinit Chandra Jha 2911 gold badge3 silver badges11 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

we need to define the array as shown in the image below, you miss the square brackets like this:

plugins: [
  [
    'react-native-reanimated/plugin', 
    { globals: ['__scanQRCodes'] }
  ]
]

see this image for proper understand

We need to do this 2 modifications:

  plugins: [
    [
      'react-native-reanimated/plugin',
      { globals: ['__scanCodes'] },
    ],
  ]

And finally:

npx react-native start --reset-cache

本文标签: javascriptglobals is not a valid Plugin propertyStack Overflow