Closed MateoZapata2022 closed 2 years ago
hey @MateoZapata2022, is this a server-side rendered app? also can you share the package&react versions?
{ "name": "visual-testing-frontend", "version": "0.1.0", "private": true, "dependencies": { "@smartbear/honeycomb": "^0.0.2", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.1.1", "@testing-library/user-event": "^13.5.0", "@types/jest": "^27.4.1", "@types/node": "^16.11.27", "@types/react": "^18.0.6", "@types/react-dom": "^18.0.2", "@typescript-eslint/eslint-plugin": "^5.29.0", "@typescript-eslint/parser": "^5.29.0", "classnames": "^2.3.1", "eslint-config-airbnb": "^19.0.4", "eslint-config-google": "^0.14.0", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-react": "^7.30.0", "eslint-plugin-react-hooks": "^4.6.0", "react": "^18.0.0", "react-dom": "^18.0.0", "react-i18next": "^11.17.2", "react-router-dom": "^6.3.0", "react-scripts": "^2.1.3", "typescript": "^4.6.3", "web-vitals": "^2.1.4" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "prepare": "cd .. && husky install .husky", "lint": "eslint .", "lint:fix": "eslint --fix", "format": "prettier --write './*/.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc" }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "devDependencies": { "@commitlint/cli": "^17.0.2", "@commitlint/config-conventional": "^17.0.2", "autoprefixer": "^10.4.4", "eslint": "^7.32.0", "eslint-config-prettier": "8.5.0", "eslint-plugin-prettier": "^4.0.0", "husky": "^8.0.1", "install-peers": "^1.0.4", "lint-staged": "^13.0.2", "postcss": "^8.4.12", "prettier": "2.7.1", "tailwindcss": "^3.0.24" }, "lint-staged": { "*/.{js,jsx,ts,tsx}": [ "npx prettier --write", "npx eslint --fix" ] }, "eslintConfig": { "extends": [ "react-app" ] } }
Not bro, its a client-side app ...
I have problem with React DOM Version https://reactjs.org/warnings/invalid-hook-call-warning.html
I Created other project from scratch, with CRA and show the same error, i have react 18 and this component has the 16 react version. do you believe that is the react version problem?
yes, it only occurs in react version ~18. I will investigate the issue tomorrow.
Hey bro, i'm pending about your solutions, your component its great and i need it, i'm make a downgrade to react to 17 but nothing ...
Thanks !!!
Hello, same problem here since i switch to React 18.
Hey, We seem to be having a similar issue. We are on next.js 12.1.5 (react, react-dom: 18.0.0).
Error shows up sporadically but stops once we remove
@magiqfoxx is it possible to share your project? if it's not please share node&npm versions with @trendyol-js/react-carousel version.
Unfortunately I can't share the project. I was trying to recreate it but no luck so far. node v16.16.0 (npm v8.11.0) @trendyol-js/react-carousel: ^3.0.0
Our dependencies:
"@carbon/react": "^1.8.0",
"@trendyol-js/react-carousel": "^3.0.0",
"chart.js": "^3.8.2",
"formik": "^2.2.9",
"mongodb": "^4.6.0",
"next": "12.1.5",
"next-auth": "^4.3.4",
"react": "18.0.0",
"react-avatar": "^5.0.1",
"react-chartjs-2": "^4.3.1",
"react-dom": "18.0.0",
"react-toastify": "^9.0.1",
"sass": "^1.50.1",
"styled-components": "^5.3.5",
"swr": "^1.3.0",
"uuid": "^8.3.2",
"yup": "^0.32.11"
Error: `Unhandled Runtime Error
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:
Error goes away when Carousel component is removed.
Also seeing this issue on React 18.
For me the roll back to v2.0.1 solved the issue. It happend with react 18.
Describe the bug
The first image is the errors and the second is the code implementation
Reproduction
System Info
Used Package Manager
npm
Logs
No response
Validations