How does React Router location.state works?

The first time I saw the React Router location.state API, I thought it was a really useful feature, somewhat magical, as is often the case with things we don’t understand. This feature allows you to pass data from one route…