Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onChanged(color) {
const { onChange } = this.props
, newColor = Color.toState(color, 0)
if (newColor.hex === this.state.color.hex)
return
this.setState({color: newColor})
onChange && onChange(newColor)
}
constructor(props) {
super(props);
this.state = {
color: colorHelper.toState(props.initialColor || '#2BD867')
};
}
constructor(props) {
super(props)
this.state = {
activePanel: 'material',
color: Color.toState(props.color || '#88F', 0),
}
}
componentWillReceiveProps(nextProps) {
if (nextProps.color) {
this.setState({color: Color.toState(nextProps.color, 0)})
}
}