javascript - .globals is not a valid Plugin property - Stack Overflow

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

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744238441a4564585.html

相关推荐

  • javascript - .globals is not a valid Plugin property - Stack Overflow

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

    8天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信