Skip to content

Instantly share code, notes, and snippets.

@zidniryi
Created April 16, 2024 10:19
Show Gist options
  • Save zidniryi/a80b81cdcf89b93bf321414079347bb6 to your computer and use it in GitHub Desktop.
Save zidniryi/a80b81cdcf89b93bf321414079347bb6 to your computer and use it in GitHub Desktop.
import React from "react";
import { SketchPicker } from "react-color";
class App extends React.Component {
state = {
background: "#fff",
};
handleChangeComplete = (color) => {
this.setState({ background: color.hex });
};
render() {
return (
<SketchPicker
color={this.state.background}
onChangeComplete={this.handleChangeComplete}
/>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment