Created
April 16, 2024 10:19
-
-
Save zidniryi/a80b81cdcf89b93bf321414079347bb6 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
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