我已经跑了
npm install @heroicons/react
我的package.json看起来是这样的:
"dependencies": {
"@headlessui/react": "^1.6.6",
"@heroicons/react": "^2.0.0",
...
但出于某种原因,我无法让它开始工作!
我还在犯这个错误
请帮帮我。我不明白这里有什么问题?
发布于 2022-08-24 15:39:08
在版本2.0.0
,根据医生的说法中,应该从以下位置导入图标:
@heroicons/react/20/solid
@heroicons/react/24/outline
@heroicons/react/24/solid
例如:
import { AcademicCapIcon } from '@heroicons/react/20/solid';
import { BeakerIcon } from '@heroicons/react/24/outline';
import { PlayIcon } from '@heroicons/react/24/solid';
function Preview() {
return (
<div>
<AcademicCapIcon />
<BeakerIcon />
<PlayIcon />
</div>
)
}
https://stackoverflow.com/questions/73462143
复制相似问题