Encode & decode QR code in React
npm install react-qr-hooks

sh
$ npm install react-qr-hooks
`Or Yarn:
`sh
$ yarn add react-qr-hooks
`Getting Started
• Import hooks in React application file:
`js
import { useQrEncode, useQrDecode } from 'react-qr-hooks';
`$3
#### Options
Name | Type | Default | Description
-|-|-|-
text | string |
| Text to encode
options | QRCodeToDataURLOptions | {} | Options for qrcode library#### Returned Values
Type | Description
-|-
string | Encoded value
$3
#### Options
Name | Type | Default | Description
-|-|-|-
data | string |
| An image from url or an element with a src attribute set
options | object | {} | Options for qrcode-decoder library#### Returned Values
Type | Description
-|-
string | value decoded from QR code
Example
`js
import React from 'react';
import { useQrEncode, useQrDecode } from 'react-qr-hooks';const App = () => {
const encoded = useQrEncode('Hello world!', / object with options (if needed) /);
const decoded = useQrDecode(encoded, / object with options (if needed) /);
return (
<>

{decoded}
>
);
}export default App;
``