Skip to content

Latest commit

 

History

History
116 lines (78 loc) · 1.73 KB

README.md

File metadata and controls

116 lines (78 loc) · 1.73 KB

React Native QR

NPM Type Definitions NPM Downloads

Qr generator library for react native.

IOS Android

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

Thanks to


Built with ♥️ by Orkun KARAKUŞ