Skip to content

Setting value with initial values does not update selected tags when adding or removing items. #4617

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

You must be logged in to vote

Hello @alveshelio,

I hope you don't mind me converting your issue to a discussion. It seemed more fitting as your query does not include an issue in the library but instead a question regarding implementation.

Your CodeSandbox example seems to be unavailable, but I had a look before and can probably offer a solution.

You used a prop called initialSelectedAddresses in your MultiSelectAddress component. This prop should contain your inital value of the Select component.
In the MultiSelectAddress component you also have a state called selectedAddresses. This seems to be your state to which you want the initial values to be applied.

As I could see (and remember) you used your initialSelectedA…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by alveshelio
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
Converted from issue

This discussion was converted from issue #4613 on June 02, 2021 07:25.