I'm trying to use NDEFReader()
for NFC scan/write in React.
This feature works from Chrome 81 (you can try it on your mobile in Chrome beta today on links below).
GoogleChromeNfcSample, WhatWebCanDoTodayNfc
To enable this feature, you need to go into chrome://flags/
and enable Experimental Web Platform features.
The problem is that I can't make this work in React. I use create-react-app with TypeScript and console output:
Cannot find name 'NDEFReader'
I think that this causes a webpack check. I already tried change some settings in tsconfig.json but nothing worked. Does anyone know, how to enable experimental js/ts compilation, to enable this feature?
Web NFC folks provide TypeScript definitions at https://github.com/w3c/web-nfc/blob/gh-pages/web-nfc.d.ts