Open
Description
I am trying to reset the color pointer button after I click a button but the pointer remains the previously selected color.
In the example below I expect the color pointer to change to white (not green, and be in the correct position) after the Set button is clicked.
const Panel = () => {
const [color, setColor] = useState('white')
const handleColorChange = (color) => setColor(color)
return (
<>
<HexColorPicker color={color} onChange={handleColorChange} />
<button onClick={() => setColor('white')}>
Set
</button>
</>
)
}
export default Panel
What am I doing wrong?
Metadata
Metadata
Assignees
Labels
No labels