@amazon-devices/@amazon-devices/react-native-qrcode-svg library provides support on Vega for react-native-qrcode-svg, which is a QR Code generator based on react-native-svg and javascript-qrcode.
This library is system-deployed and available to React Native for Vega apps without a separate installation process. The library is deployed as an autolinking library, which your app links to at runtime. The library is guaranteed to be compatible only with the version of React Native for Vega for which it’s built.
When you uplevel your app’s version of React Native for Vega, consider the best practice of upleveling its library dependencies.
For more information about this library and its API, see the README.md in the official GitHub repo.
Installation
-
Add the JavaScript library dependency in the
package.jsonfile: -
Due to a known issue with React Native dependencies, you must apply the following workaround:
a. Open your .npmrc file in the same directory as your app’s package.json file. If the .npmrc file doesn’t exist, you can add one.
b. Add the following line:
-
Reinstall the dependencies using the
npm installcommand.
Examples
The following code is an example of creating a QRcode using the default settings:API reference
Props
Known issues and limitations
Your app might crash if you use thereact-native-qrcode-svg library and try to import the TextEncoder property. To work around this issue, add a dependency on fast-text-encoding to your app.
In your app’s package.json file, add the following to the dependencies section:
react-native-qrcode-svg library, import fast-text-encoding.

