react-native-qr
v1.0.0
Published
Qr generator for react native
Downloads
12
Readme
Features
- Native code based
- Write with Objective-C and Kotlin
- New Architecture support
- Base64 based png export
Installation
npm i react-native-qr
# or (yarn)
yarn add react-native-qr
# or (pnpm)
pnpm i react-native-qr
# or (bun)
bun add react-native-qr
Linking
IOS
You need to install pods
cd ios && pod install
Android
Autolinking on android side !
Usage
Simple
import { generateQrCode } from 'react-native-qr';
const SIZE = 250;
const TEXT = 'https://orkunkarakus.com';
// ...
const [result, setResult] = useState<string | undefined>();
useEffect(() => {
generateQrCode(TEXT, SIZE).then((img: string | undefined) => {
if (!img) {
return;
}
setResult(img);
});
}, []);
// ...
return (
// ...
<Image
source={{
uri: result
}}
style={{
width: SIZE,
height: SIZE
}}
/>
// ...
);
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
- MIT