我一直在尝试自定义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}
/>
Run Code Online (Sandbox Code Playgroud)