JedWatson / JedWatson/react-select
isMulti in AsyncSelect - typescript
Open
Nobody has claimed this yet.
issue/bug-unconfirmed
- Dominant language
- TypeScript
- Stars
- 28k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hi everyone,
I have a problem, when I want to use AsyncSelect with isMulti={true} I see TS error
<AsyncSelect
isMulti={true}
cacheOptions={false}
loadOptions={loadOptions}
closeMenuOnSelect={true}
formatOptionLabel={FormatOptionLabel}
components={{ Control, MenuList }}
styles={selectStyles}
placeholder={placeholder}
noOptionsMessage={noOptionsMessage}
openMenuOnClick={false}
onChange={selectedOptions => setValue(selectedOptions)}
value={value}
isDisabled={isDisabled}
onKeyDown={e => e.key === 'Enter' && changeQuery()}
inputValue={inputValue}
onInputChange={(newValue, { action }) => action !== 'menu-close' && setInputValue(newValue)}
/>
(property) isMulti?: false | undefined
Support multiple selected options
Type 'true' is not assignable to type 'false'.ts(2322)
Someone has any idea for it?
I'm using:
react-select: 5.7.0
typescript: 4.9.4
react: 18.2.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the TypeScript definitions for the AsyncSelect entry point in react-select 5.7.0 and reproduce the reported error with isMulti={true}. Determine why the prop is inferred as false, then verify that the shown AsyncSelect usage type-checks without the error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100