Created
July 24, 2022 18:05
-
-
Save SOliv1/503a0cb1a749797581ecba584821b560 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://gist.github.com/4e42075b9544483d5bd3afca31dd9ee3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
view here
['Aquamarine', 'BlueViolet', 'Chartreuse', 'CornflowerBlue', 'Thistle', 'SpringGreen', 'SaddleBrown', 'PapayaWhip', 'MistyRose'];
export default function ColorPicker() {
const [color, setColor] = useState("Tomato");
const divStyle = {backgroundColor: color};
return (
Selected color: {color}
{colorNames.map((colorName)=>(
<button
onClick={() => setColor(colorName)}
key={colorName}>
{colorName}
))}
);
}