gpt4 book ai didi

reactjs - 无法在 Primereact 下拉列表中解析 'react-transition-group'

转载 作者:行者123 更新时间:2023-12-04 13:09:53 30 4
gpt4 key购买 nike

我收到以下错误-

Failed to compile
./node_modules/primereact/components/dropdown/DropdownPanel.js
Module not found: Can't resolve 'react-transition-group' in 'D:\my-app\node_modules\primereact\components\dropdown'
这是我的 package.json
  "dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/react-transition-group": "^4.4.1",
"primeflex": "^2.0.0",
"primeicons": "^4.1.0",
"primereact": "^6.1.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
在 App.js 中
import React, { useState } from 'react';
import { Dropdown } from 'primereact/dropdown'; //getting error after adding this line
import 'primeflex/primeflex.css';
我在这里缺少什么?

最佳答案

难道你只包含了类型,"@types/react-transition-group": "^4.4.1", ,但没有安装实际的包?
尝试使用 npm install react-transition-group 安装软件包. @types/* repo 只包含类型,不包含代码。

关于reactjs - 无法在 Primereact 下拉列表中解析 'react-transition-group',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66622904/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com