I have been using React-bootstrap to style my buttons, however, I am facing difficulty in overriding the default btn
and btn-danger
classes provided by Bootstrap. Is there a way for my custom class slotTiming-box-button
to take precedence over the btn
and btn-danger
classes without resorting to ids or !important
? I can only use classNames for this purpose.
Sample React code snippet
<Button
className="slotTiming-box-button"
variant="danger"
>
Click Me
</Button>
Output HTML element
<button type="button" class="slotTiming-box-button btn btn-danger">Click Me</button>
Refer to the Computed section image (in Developer Tools) of the Button here.
I attempted to follow a solution provided here, but it was not very clear.