Not able to import hook (typescript)
See original GitHub issueLib has not exported neither useScanBarcodes
BarcodeFormat
from ‘vision-camera-qrcode-scanner’; version 0.1.4. So there is no way to use it actually.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Cant use react hooks with typescript - Stack Overflow
The source code in the tsx file uses react hooks correctly, the compiled version appears to use them correctly too. Source code (tsx)....
Read more >Typescript - Unable to import IE11 supporting code #859
I see the file if I navigate to node_modules/react-hook-form/dist, but TS doesn't seem to acknowledge that it's there and casts useForm to any...
Read more >React & TypeScript: how to type hooks (a complete guide)
Hooks are a fundamental aspect of writing React components, so knowing how to type them is vital to using TypeScript with React.
Read more >Hooks FAQ - React
Do Hooks cover all use cases for classes? Our goal is for Hooks to cover all use cases for classes as soon as...
Read more >TypeScript and React: Hooks - fettblog.eu
Check out how you can use hooks with TypeScript! ... import React, { FunctionComponent, useState } from 'react'; ... That's not the only...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
sorry guys, this is not published in npm yet, at the beginning of the next month I will have more time to test all this. in this mean time you should follow Readme of npm package or install this lib directly from github
Ah, ok, for posterity, after installing this directly from Github (
"vision-camera-qrcode-scanner": "rodgomesc/vision-camera-qrcode-scanner"
inpackage.json
) I ended up with:And typing issues are now resolved. The new
useScanBarcodes
hook is the piece that hasn’t made it into an NPM release yet.README on NPM is the
0.1.4
README, and offers a complete example that works without theuseScanBarcodes
hook.