Reactjs AsyncSelect不会更改加载消息或无选项消息(react select library)

Reactjs AsyncSelect不会更改加载消息或无选项消息(react select library),reactjs,react-select,Reactjs,React Select,我一直在尝试自定义react-select-AsyncSelect加载消息和无选项消息,但到目前为止运气不佳 以下是我当前的代码: <AsyncSelect noOptionsMessage={() => 'nothing found'} LoadingMessage={() => 'searching...'}

我一直在尝试自定义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}
                    />
“未找到任何内容”}
LoadingMessage={()=>“正在搜索…”
缓存选项
loadOptions={searchForPointsOfInterest}
getOptionLabel={(option)=>option.name}
getOptionValue={(选项)=>option}
默认选项
isRtl={true}
isClearable={true}
占位符=“示例”
isLoading={isLoading}
onChange={onPointOfInterestChange}
defaultValue={props.area}
/>
我已经准备好了。请检查一下。除了错误的
加载消息
道具名称,我没有看到错误。

应该是这样的

<AsyncSelect
    noOptionsMessage={() => 'nothing found'}
    loadingMessage={() => 'searching...'}   //minor type-O here
    cacheOptions
    loadOptions={searchForPointsOfInterest}
    getOptionLabel={(option) => option.name}
    getOptionValue={(option) => option}
    defaultOptions
    isRtl={true}
    isClearable={true}
    placeholder="example"
    isLoading={isLoading}
    onChange={onPointOfInterestChange}
    defaultValue={props.area} />
“未找到任何内容”}
loadingMessage={()=>'搜索…}//此处为次要类型-O
缓存选项
loadOptions={searchForPointsOfInterest}
getOptionLabel={(option)=>option.name}
getOptionValue={(选项)=>option}
默认选项
isRtl={true}
isClearable={true}
占位符=“示例”
isLoading={isLoading}
onChange={onPointOfInterestChange}
defaultValue={props.area}/>
如果您的问题没有解决,请在问题中添加loadOptions和onChange的更多详细信息