我将组件设置为可动态调用:
index.tsx
import dynamic from "next/dynamic";
import { PhoneNumberInputProps } from "./components/PhoneNumberInput";
const PhoneNumberInput = dynamic<PhoneNumberInputProps>(
() => import("./components/PhoneNumberInput") as any
);
组件/电话号码输入.tsx
...
import PhoneInput from "react-phone-number-input";
...
export type PhoneNumberInputProps = {...};
export const PhoneNumberInput = ({...}: PhoneNumberInputProps) => {
...
}
所以,react-phone-number-input
不应该是初始捆绑包的一部分,对吗?但是当我分析它时它仍然存在。为什么?