gpt4 book ai didi

reactjs - 找不到模块 : Error: Can't resolve 'react-select' with typescript

转载 作者:行者123 更新时间:2023-12-04 00:29:40 29 4
gpt4 key购买 nike

模块导入对我不起作用。我尝试了堆栈溢出和其他提供的不同解决方案。
这些是我遵循 react-select 的步骤

npm install --save @types/react-select

像这样导入模块
import Select from "react-select"

但我得到了错误

Module not found: Error: Can't resolve 'react-select'


import * as React from "react";
import ReactSelect from 'react-select'
export class Select extends extends React.Component<someProps>{

render(){
return(
<Select id="color" options={options} />
);
}
}

但我找不到解决这个问题的方法。

最佳答案

我通过 npm i react-select 得到了解决方案.

关于reactjs - 找不到模块 : Error: Can't resolve 'react-select' with typescript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53279686/

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