我一直在尝试自定义 react-select AsyncSelect 加载消息和没有选项消息,但到目前为止还没有运气。
这是我当前的代码:
<AsyncSelect
noOptionsMessage={() => 'nothing found'}
LoadingMessage={() => 'searching...'}
cacheOptions
loadOptions={searchForPointsOfInterest}
getOptionLabel={(option) => option.name}
getOptionValue={(option) => option}
defaultOptions
isRtl={true}
isClearable={true}
placeholder="example"
isLoading={isLoading}
onChange={onPointOfInterestChange}
defaultValue={props.area}
/>
最佳答案
我已经准备好了sandbox .请检查一下。除错loadingMessage
Prop 名称我没有看到错误。
关于reactjs - AsyncSelect 不会更改加载消息,也不会更改选项消息(react-select 库),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62621201/