As the new URL also uses the same component, it doesn't reload the data and re-render it. The solution is simple. You could trigger an event when your URL changes and listen to that event in your component. In case the slug is different from the current one you need to call your fetchData function and do a setState() so that the component re-renders itself.
For example, you can do a simple check as following in your component :
onEventTriggered(state) {
if(state.event === 'pathChange'){
var path = this.context.location.pathname;
var slug = path.substring(path.lastIndexOf('/post/') + 6);
if(slug !== this.state.post.slug) {
fetchData();
}
}
}
Let me know if you have any questions!