【发布时间】:2022-06-14 21:06:56
【问题描述】:
我刚刚更新了 react-select 库,我发现它不再起作用了。在the official site 上,我发现了这个升级指南,它对我没有帮助而且什么也没说。
我也检查了samples on their site,但它给了我同样的错误。
例如,我想做一个非常基本的可创建选择:
import AsyncCreatableSelect from 'react-select/async-creatable';
const promiseOptions = (inputValue: string) =>
new Promise<any[]>((resolve) => {
setTimeout(() => {
console.log('searching...');
}, 1000);
});
const Select: React.FC = () => {
return (
<AsyncCreatableSelect
cacheOptions
defaultOptions
loadOptions={promiseOptions}
/>
);
};
我在项目中选择的所有其他选项都相同。你知道如何解决它吗?
我收到的错误如下:
我使用nextjs 12.1.2 react 18.0.0 和 typescript 4.6.3 和 react-select 5.2.2
【问题讨论】:
标签: reactjs typescript next.js react-select