Skip to content

Starting multi with already selected icons #314

Closed Answered by csandman
gustavool1 asked this question in Q&A
Discussion options

You must be logged in to vote

Sure, just pass the options you'd like to be selected by default in the value prop:

const MySelect = () => {
  const [selectedPeople, setSelectedPeople] = useState([
    { label: "Jorge", value: "Jorge" },
    { label: "Matheuw", value: "Matheuw" },
  ]);

  return (
    <Select isMulti value={selectedPeople} onChange={setSelectedPeople} />
  );
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gustavool1
Comment options

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