Skip to content

orkunkarakus/react-native-qr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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Ş