DEV Community

Discussion on: React, React-Router and Fetch API

Collapse
 
nqbinh17 profile image
nqbinh17

Hey, I got the same problem with you. If you use HashRouter and click on its siblings, React only changes params in your Class Work, so componentDidMount will not be called again => webpage is not updated! You can add componentDidUpdate to fix this, or put this.handleClick() directly in Render() ( because React will invoke this as you click on another product).