react-transition-group
react-transition-group copied to clipboard
Compiled Error in ReactJS/Typescript project
Hello Team. I'm including react-transition-group to my ReactJS/Typescript project for using animation. By this command
npm i react-transition-group
npm i @types/react-transition-group
It already was installed without error but when i called TransitionGroup component i got some error:
Compiled with problems:X
ERROR in ./node_modules/dom-helpers/esm/hasClass.d.ts 7:40
Module parse failed: Unexpected token (7:40)
File was processed with these loaders:
* ./node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
* @param className the CSS class name
*/
> export default function hasClass(element: Element | SVGElement, className: string): boolean;
Below is my package.json
{
"name": "project",
"version": "0.1.0",
"private": true,
"homepage": "/",
"dependencies": {
"@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.5",
"@types/react-dom": "^18.0.1",
"@types/react-transition-group": "^4.4.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-scripts": "5.0.1",
"react-transition-group": "^4.4.0",
"typescript": "^4.6.3",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject",
"cp:lib2": "cpx ../plan_lib2/dist/plan_lib2.min.js public/js",
"cp:types": "cpx ../plan_lib2/dist/types/** src/types/plan_lib2"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"autoprefixer": "^10.4.4",
"customize-cra": "^1.0.0",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.29.4",
"postcss": "^8.4.12",
"prettier": "^2.6.2",
"react-app-rewired": "^2.2.1",
"tailwindcss": "^3.0.24",
"ts-loader": "^9.2.8"
}
}
Thank you