!important inline styles in react

Apparently React does not support this. But i got this hack as i did my research

    <div ref={(node) => {
      if (node) {
        node.style.setProperty("float", "right", "important");
      }
    }}>                    
    </div>

Good luck:)


20+'!important' is '20!important'.

When you just give a number, react adds "px" for you; but you're using a string, so you have to specify the unit. Also I'm pretty sure there needs to be a space between "!important" and whatever's to the left of it.

style={{ height: '20px !important' }};