Skip to content

Is there a way to customize the id prop from ColorSwatchPicker? #7611

Answered by devongovett
hgodinho asked this question in Q&A
Discussion options

You must be logged in to vote

The id must be set based on the value because of this:

selectedKeys={[state.color.toString('hexa')]}

If your intent is to change the color to a different one, you could provide a different React key to the ColorSwatchPickerItem so it unmounts and remounts a new instance of the component.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@devongovett
Comment options

Answer selected by hgodinho
@hgodinho
Comment options

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