koder
koder copied to clipboard
Help with a React quickstart
Your library looks incredible, Mr Maslov! Sorry for looking like a complete moron but I never worked before with wasm and I am a bit too lost trying to implement anything, just make it work with a simple create-react-app type of base. I tried to organize the React component but it looks way too much to try to adapt into a small, working, piece of component.
Would you have any small snippet on how to simply make it work with a React app? Thank you so much!
Hi Pedro, thank you! For the React example you can use this very repo. There was no point in creating a separate repo for that. In fact it is created using create-react-app.
You can check out the vanilla-js example https://github.com/maslick/koder-vanilla-js if you wish.
This repo doesn't provide a React component in the form of an npm library. Contrary, this repo is an integration example, which you can reuse while building your own QR-code scanner apps.
There's an npm package, however, but it only works for node.js server-side apps and Browser apps (see https://github.com/maslick/koder-vanilla-js).
If you don't want to bother much with all the integrations (WASM, Web workers, Service workers, etc.), and all your web app needs is the ability to scan QR/bar codes, take a look at Kameroon - QR/bar code scanner as a Service https://github.com/maslick/kameroon. There are two demo apps:
- React app: https://github.com/maslick/kameroon-demo
- Vanilla js app: https://github.com/maslick/kameroon-demo-js
Here's some description I gave on how Kameroon works: https://github.com/maslick/koder/issues/81#issuecomment-1717071941