For ALL the components I'm using with React-Bootstrap, all the styling is working EXCEPT for close buttons that are built into Modals, Alerts, etc. Examples below.
Alert Component - Expected
Alert Component that I see
Modal Component - Expected
Modal Component that I see
The same thing is happening for npm packages that I'm using that are built on top of React-Bootstrap, like React-Bootstrap-Typeahead.
These are the dependencies I'm using:
"bootstrap": "^5.0.0-beta1",
"popper.js": "^1.16.1",
"react-bootstrap": "^1.4.0",
"react-bootstrap-typeahead": "^5.1.4"
I import Bootstrap CSS in my index.js file:
import 'bootstrap/dist/css/bootstrap.min.css';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
I import React-Bootstrap in my files like this and everything works without a problem EXCEPT the close buttons.
import { Modal, Button, Alert } from 'react-bootstrap';
I'm not importing Popper.js or Bootstrap.js anywhere though. Does anyone know what could be going wrong?
Edits
Underneath is the button being rendered in the HTML DOM and the styles being applied. Strangely, there are no styles being applied for the .close class on the button (and no styles for this in bootstrap.min.css). Also, the majority of the styles related to the button visuals are from the user agent stylesheet
/* From user agent stylesheet */
button {
appearance: button;
-webkit-writing-mode: horizontal-tb !important;
text-rendering: auto;
color: -internal-light-dark(black, white);
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: center;
align-items: flex-start;
cursor: default;
background-color: -internal-light-dark(rgb(239, 239, 239), rgb(59, 59, 59));
box-sizing: border-box;
margin: 0em;
font: 400 13.3333px Arial;
padding: 1px 6px;
border-width: 2px;
border-style: outset;
border-color: -internal-light-dark(rgb(118, 118, 118), rgb(133, 133, 133));
border-image: initial;
}
/* The appearance, text-transform, cursor, and margin properties
are being over-riden by _reboot.scss below */
/* From bootstrap/scss/_reboot.scss */
[type=button]:not(:disabled), button:not(:disabled) {
cursor: pointer;
}
/* This style is being over-riden*/
[type=button], button {
-webkit-appearance: button;
}
button {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
text-transform: none
border-radius: 0;
}
<button type="button" class="close">
<span aria-hidden="true">×</span>
<span class="sr-only">Close alert</span>
</button>




