tbolis / react-sketch

Sketch Tool for React-based applications, backed up by FabricJS
http://tbolis.github.io/showcase/react-sketch/
MIT License
683 stars 230 forks source link

Default backgroundColor color cant be set without a setState() #87

Open TheBoef opened 5 years ago

TheBoef commented 5 years ago

I'm unable to set a backgroundColor to something other then 'transparent' when loading a SketchField

Even when I change your example main. (Line:354)

backgroundColor={
  this.state.fillWithBackgroundColor
    ? this.state.backgroundColor
    : 'transparent'
}

Too

backgroundColor={
  this.state.fillWithBackgroundColor
    ? this.state.backgroundColor
    : '#F44E3B'
}

And set the default state of backgroundColor to '#F44E3B' it's still transparent it only changes when I press the switch and call a this.setState()