0

Here is my code

eventStyleGetter(event, start, end, isSelected) {
      if (event.id == 39) {
            var style = {
                backgroundColor: '#409931',
                borderRadius: '0px',
                opacity: 0.8,
                color: 'red',
                border: '0px',
                display: 'block'
            };

        }

        return {
            style: style
        }

 }

I want to change the background color but it is overridden with another CSS style. How to override this background color with react js.

enter image description here

Community
  • 1
  • 1
Kusal Kithmal
  • 1,255
  • 1
  • 10
  • 25

1 Answers1

1

Rather than applying this as a style, dynamically apply a className, using the same eventPropGetter method. classNames are appended, so any className that you apply to the event will be parsed after the default classes, and you can use !important in the class definition.

Steve -Cutter- Blades
  • 5,057
  • 2
  • 26
  • 40
  • Side Note: `className`s, returned from your `eventPropGetter`, are expected to be a String, and not an Object, so if you ever have more than one they must be in a space delimited list (i.e. `className: 'custom-style1 blocked-event'`) – Steve -Cutter- Blades Feb 26 '19 at 17:27