Next.js 13,带有客户端组件的应用程序目录。我在进口安全帽时遇到了问题。
的数据
组件代码:
"use client";
import { Faucet } from "./scaffold-eth";
import { hardhat } from "wagmi/dist/chains";
import { CurrencyDollarIcon } from "@heroicons/react/24/outline";
import { useGlobalState } from "~~/services/store/store";
import { getTargetNetwork } from "~~/utils/scaffold-eth";
export default function NativeCurrencyPrice() {
const nativeCurrencyPrice = useGlobalState(state => state.nativeCurrencyPrice);
return (
<div className="flex space-x-2 pointer-events-auto">
{nativeCurrencyPrice > 0 && (
<div className="btn btn-primary btn-sm font-normal cursor-auto">
<CurrencyDollarIcon className="h-4 w-4 mr-0.5" />
<span>{nativeCurrencyPrice}</span>
</div>
)}
{getTargetNetwork().id === hardhat.id && <Faucet />}
</div>
);
}
字符串
1条答案
按热度按时间cs7cruho1#
我使用自动导入导致错误的路径。
代替该路径
字符串
使用此路径
型