-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FinalFormAsyncSelect
, AsyncSelectField
, and FinalFormAsyncAutocomplete
components
#2069
Conversation
Thin wrappers to ease using `useAsyncOptionsProps()` with `FinalFormSelect` and `FinalFormAutocomplete`. **Example** Previously: ```tsx const asyncOptionsProps = useAsyncOptionsProps(async () => { // Load options here }); // ... <Field component={FinalFormAsyncAutocomplete} {...asyncOptionsProps} />; ``` Now: ```tsx <Field component={FinalFormAsyncAutocomplete} loadOptions={async () => { // Load options here }} /> ```
@jamesricky do you also want a AsyncSelectField? And there is no AutocompleteField?! |
If that reduces the code that has to be written when building a form: yes |
What do you think about conditionally rendering the component in SelectField based on the props? |
That would be cool 👍🏼 |
I tried this, but it doesn't make sense IMO. AsyncSelectField shouldn't support children etc. which SelectField supports. Having two separate components is probably better. |
FinalFormAsyncSelect
and FinalFormAsyncAutocomplete
componentsFinalFormAsyncSelect
, AsyncSelectField
, and FinalFormAsyncAutocomplete
components
Done in #2141. |
Thin wrappers to ease using
useAsyncOptionsProps()
withFinalFormSelect
andFinalFormAutocomplete
.Example
Previously:
Now:
COM-793