question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to import hook (typescript)

See original GitHub issue

Lib 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:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
rodgomesccommented, Oct 25, 2021

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

2reactions
chiubakacommented, Nov 15, 2021

Ah, ok, for posterity, after installing this directly from Github ("vision-camera-qrcode-scanner": "rodgomesc/vision-camera-qrcode-scanner" in package.json) I ended up with:

import {
  Barcode,
  BarcodeFormat,
  useScanBarcodes,
} from "vision-camera-qrcode-scanner/src";

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 the useScanBarcodes hook.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found