Closed nikdo closed 4 years ago
There is nothing wrong with react-router. There is an incorrect lifecycle method and condition for calling fetchSpotDetail
from SpotDetail
container. It should react to ID change too, but it should not do history.push
in that case.
history.push
only from searchuseHistory
hookfetchSpot
on ID change from SpotDetail
container
useEffect
condition to respect ID changeuseEffect
useMatch
hookSpotDetail
Time estimated: 6h Time spent: 4h
Steps to reproduce:
Current behavior: Spot is not changed. Browser history reacts only to home page ↔ detail page change.