Skip to main content

React Web Installation

1

Install the package

Choose your preferred package manager to install react-qr-code:
npm i react-qr-code
2

Verify installation

Import the component in your React application:
import QRCode from "react-qr-code";
Peer Dependency: react-qr-code requires React ^19.2.3 as a peer dependency.

React Native Installation

When using this library with React Native, you’ll need additional setup for SVG support.
1

Install react-qr-code

npm i react-qr-code
2

Install react-native-svg

React Native requires the react-native-svg library to render SVG elements.
npm i react-native-svg
See the react-native-svg installation guide for more details.
3

Install iOS dependencies

For iOS, install the CocoaPods dependencies:
cd ios && pod install
4

Verify installation

Import the component in your React Native application:
import QRCode from "react-qr-code";
The react-native-svg dependency is required for React Native but is not automatically installed. Make sure to install it separately.

Next Steps

Now that you have react-qr-code installed, head over to the Quickstart guide to create your first QR code.

Build docs developers (and LLMs) love