I literally copy-pasted the navbar from the Bootstrap page and changed "class" for "className" in each case because I'm working in React. Then I just put the <Link> inside the <a> item, but even if I replace the <a> with the <Link> it doesn't work in any of both cases. I have also tried replacing the ul with a div and simply puting the links inside. And I also imported jquery to index.js, all solutions that I came with looking in a lot of places. But I simply can't make this work. I'm starting to suspect there is some kind of bug with React-Router and BS working together. But anyway, perhaps you can tell me what am I doing wrong.
The button appears, but nothing happens when I click it. The Links should dropdown but they don't.
update: the Links do work in a non-toggling-button navbar. So it is not an issue of react-dom. It is a bootstrap one.
import React from "react";
import {Link} from "react-router-dom";
const Navbar = () => {
    return (
    <nav className="navbar navbar-expand-lg navbar-light bg-light">
  <div className="container-fluid">
    <a className="navbar-brand">Crea tu equipo de superhéroes</a>
    <button className="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
      <span className="navbar-toggler-icon"></span>
    </button>
    <div className="collapse navbar-collapse" id="navbarNav">
      <ul className="navbar-nav">
        <li className="nav-item">
          <a className="nav-link active" aria-current="page"><Link to="/">Favoritos</Link></a>
        </li>
        <li className="nav-item">
          <a className="nav-link"><Link to="/Search">Búsqueda</Link></a>
        </li>
      </ul>
    </div>
  </div>
</nav>
    )
}
export default Navbar;
App.js :
import React from 'react';
import './App.css';
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import Navbar from "./Navbar";
import Home from "./Home";
import Search from "./Search";
const App = () => {
 return ( 
        <Router>
            <Navbar/>
            <Switch>
                <Route exact path="/">
                    <Home/>
                </Route>
                <Route path="/Search">
                    <Search/>
                </Route>
            </Switch>
        </Router>
 )
}
 
    