Skip to content

Debounce with LoDash callback issue #4931

Answered by Rall3n
SKempin asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @SKempin,

I hope you don't mind me converting your issue to a discussion as it seemed a more appropriate place for your question.

There are a couple of problems with what you are trying to do:

  1. The extra Promise chain with your console.log call causes the data parameter in the next chain to be empty.
  2. callback expects the first parameter to be an array of options, but you send the whole data as part of an object as the second parameter. Correct is:
    callback(data?.items);
  3. Now we have options, but the component does not know of value and label. Either convert the data to objects of schema {value,label} or use the getOptionValue and getOptionLabel props.
    <AsyncSelect
        getOptionValue={

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@SKempin
Comment options

@Rall3n
Comment options

@SKempin
Comment options

@Rall3n
Comment options

Answer selected by SKempin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet
2 participants
Converted from issue

This discussion was converted from issue #4930 on November 25, 2021 12:30.