I've been using Bootstrap 5 for a while not noticing something may not work.
Then I found a model requires @popper/core, not just popper.js.
I installed it and suddenly my dropdowns stopped working.
The context: I use the dropdown in my React JSX layout.
React 16.11.0 Bootstrap 5.1.3
Some code:
import Popper from '@popperjs/core';
import $ from 'jquery';
//import { Dropdown } from 'bootstrap'; <-- doesn't help
import 'bootstrap/dist/js/bootstrap.bundle.min';
...
<div className="dropdown">
<button className="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown button
</button>
<ul className="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a className="dropdown-item" href="#">Action</a></li>
<li><a className="dropdown-item" href="#">Another action</a></li>
<li><a className="dropdown-item" href="#">Something else here</a></li>
</ul>
</div>