tbleckert / react-select-search

⚡️ Lightweight select component for React
https://react-select-search.com
MIT License
674 stars 149 forks source link

emptyMessage doesn't supports ()=>JSX.Element #226

Open jgarmar opened 2 years ago

jgarmar commented 2 years ago

Describe the bug Example isn't working in a TSX file:

<SelectSearch
  options={options}
  search
  filterOptions={fuzzySearch}
  emptyMessage={() => (
    <div style={{ textAlign: "center", fontSize: "0.8em" }}>
      Not found renderer
    </div>
  )}
  placeholder="Select your country"
/>

TypeScript says that Type '() => JSX.Element' cannot be assigned to type 'string | (() => string) | undefined'

image

It would also be interesting if some action could be carried out with that query, for example creating it.

tbleckert commented 2 years ago

Thanks for the report, will fix asap!