Skip to content
Discussion options

You must be logged in to vote

The DropDownPicker setValue state callback doesn't return a new field value, but rather a useState's setValue`-like callback that takes the current field value as an argument to resolve the new field value.

<DropDownPicker
  value={field.value}
  setValue={cb => {
    const newValue = cb(field.value)
    field.onChange(newValue)
  }}
/>

Here's a working example codesandbox.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@msafi04
Comment options

@jchiversTRG
Comment options

@PavelTankovich
Comment options

Answer selected by msafi04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants