In the menu, if you are using Bootstrap 4, this is the button that is in the mobile version. The only difference I found in your code was navbar-toggle (in my navbar-toogler ). But I do not know if that's it. Among the most important settings of this menu is the data-target which basically points to the ID in the menu that collapses.
<button
className="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon" />
The menu that collapses is something like this
<div class="collapse navbar-collapse text-center" id="navbarSupportedContent">
<ul>
<li></li>
<li></li>
</ul>
</div>