We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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?
The text was updated successfully, but these errors were encountered:
Hi Grant! Are you good? Hope you going well!
This can be solved by adding hex color instead of the color name. You are importing a component that handles with hex color only.
const Panel = () => { const [color, setColor] = useState("#ffffff"); const handleColorChange = (color) => setColor(color) return ( <> <HexColorPicker color={color} onChange={handleColorChange} /> <button onClick={() => setColor("#ffffff")}>Reset</button> </> ) } export default Panel
Sorry, something went wrong.
No branches or pull requests
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.
What am I doing wrong?
The text was updated successfully, but these errors were encountered: