Open tai30101997 opened 2 years ago
Hi @beenotung, I got the same problem too. I'm using React 18.2.0. This is my project package
"dependencies": {
"@reduxjs/toolkit": "^1.9.5",
"i18n-js": "^4.3.0",
"qr-scanner": "^1.4.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.12.0",
"react-qr-code": "^2.0.12",
"react-redux": "^8.1.2",
"react-router-dom": "^6.17.0",
"react-webcam-qr-scanner.ts": "^1.0.4",
"styled-components": "^6.1.1"
},
"devDependencies": {
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@vitejs/plugin-react": "^4.2.0",
"eslint": "^8.53.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"prettier": "^3.0.3",
"typescript": "^5.2.2",
"vite": "^5.0.0"
}
This is the page
const Scan: React.FC = () => {
const [qrCode, setQrCode] = useState<string>('');
const onQrCode = (qrCode: string) => {
setQrCode(qrCode);
};
return (
<div>
<OneOffQrScanner onQrCode={onQrCode} hidden={false} />
</div>
);
};
And this is my directory structure
Hi @tai30101997, may I know what version of react are you using? Would be great if you can share a trim down version of project reproducing the bug without unrelated parts (e.g. trim away login, server API parts)