To allow Google Messages to do it, go to the Google Messages Settings by tapping the profile icon and then finding and ...
But, unlike Waze, Google Maps won't automatically reroute you based on that real-time info. If something pops up ahead, it's on you to decide whether to take a detour or stick with the original route.