Skip to content

Commit

Permalink
Remove cWRP from ChromeFields (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 authored and casesandberg committed Jan 8, 2020
1 parent 57fc5b5 commit d1e09d3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/chrome/ChromeFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ export class ChromeFields extends React.Component {
}
}

componentWillReceiveProps(nextProps) {
if (nextProps.hsl.a !== 1 && this.state.view === 'hex') {
this.setState({ view: 'rgb' })
static getDerivedStateFromProps(nextProps, state) {
if (nextProps.hsl.a !== 1 && state.view === 'hex') {
return { view: 'rgb' }
}
return null
}

toggleViews = () => {
Expand Down

0 comments on commit d1e09d3

Please sign in to comment.