DEV Community

Discussion on: 5 Tips Every React Developer Should Know

 
ruppysuppy profile image
Tapajyoti Bose • Edited

The purpose of a separate layout would be to keep the routing logic separate from the ui logic. But you are correct about the re-rendering of the components.

I have used useHistory for only navigation, so I don't have enough knowledge to comment on how it compares to withRouter

Thanks for your input :)