So this is my situation:
I have App.jsx
that renders this:
<BrowserRouter>
<Switch>
<Route path="/" exact component={MovieList} />
<Route path="/search/:search" component={MovieList} />
</Switch>
</BrowserRouter>
Now no matter if I'm on either one of these Routes, inside MovieList
component there is a loop through list of Movie
, and in each Movie
there's a <Link />
to the same Route, for example:
<Link to="/search/goodmovie" />
The thing is, if I click on that link, nothing happens, and it happens because its on the same route, if for example I changed it to something else, <Link to="/blabla" />
it worked and redirected.
So how can I make it render again even if I want to link to the Route I'm currently in?
Edit: an example for a Movie
component:
<div>
<p class="text">{props.text}</p>
<Link to="/search/test">Test link</Link>
</div>