-
-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Hi, there seems to be an issue with useDymoCheckService()
When trying to use it it throws an error.
`Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
- You might have mismatching versions of React and the renderer (such as React DOM)
- You might be breaking the Rules of Hooks
- You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.`
This is pretty simple to reproduce.
1.- Start a new react project
npx create-react-app dymo-demo
2.- cd dymo-demo/
3.- npm install react-dymo-hooks
4.- Open the code and in App.js simply call the useDymoCheckService() method like so...
5.- npm start
Result
Blank screen with the error in the console. Following the debugger is pointing at this part of the code..
My package.json looks like this...
{
"name": "dymo-demo",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dymo-hooks": "^2.0.2",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

