3

I'm using Semantic-ui-react, I am getting

Dropdown value must be an array when multiple is set. Received type: `[object Undefined]

<Dropdown id={id + 'baa'}
    fluid selection
    search={true} 
    minCharacters={0} 
    multiple={false}
    loading={isDataBeingFetched} 
    disabled={!isOwnerView || isDataBeingFetched}
    options={options1}
    placeholder={'Select an Approver'}
    value={currentItem.baa_approver}
    onChange={(event, { value }) =>
    this.handleOnChange(currentIndex, value, 'baa_approver', event)}
 />
3
  • 3
    The error states that value attribute should be an array, but currently it's an undefined object. You may want to revisit currentItem.baa_approver value.. Commented Nov 11, 2018 at 13:54
  • Its in foreach (currentItem). I am checking whether its undefined or not. but still getting same Error Commented Nov 12, 2018 at 8:57
  • Hi @Ramya. Were you able to fix this? I'm getting the same console error when the value is an array. Seems like a bug. Updating semantic-ui-react to the latest version didn't help. Commented Feb 20, 2019 at 17:11

1 Answer 1

4

use defaultValue={currentItem.baa_approver} instead of value={currentItem.baa_approver}

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.