react-color icon indicating copy to clipboard operation
react-color copied to clipboard

Nothing work!!!!

Open deadlyengineer opened this issue 3 years ago • 2 comments

It has only a static value, #22194D I can't change the color.

deadlyengineer avatar Aug 31 '21 02:08 deadlyengineer

I was same situation with you. But each picker must be given color props like following.

export class Editor extends React.Component {
  state = {
    color: '#ffffff',
  };
  public render(): ReactNode {
    return (
      <SketchPicker
        color={this.state.color}
        onChangeComplete={(v) => this.handleChangeComplete(v)}
      />
    );
  }
  private handleChangeComplete(color: ColorResult) {
    this.setState({
      color: color.hex,
    });
  }
}

I wish this comment is useful for other developers who is under the same issue :pray:

jupemara avatar Oct 29 '21 10:10 jupemara

use this version, lastest version has bugs; "react-color": "2.17.1",

sanxyzhang avatar Nov 04 '21 07:11 sanxyzhang