A Convenient feature offered by React Router

A Convenient feature offered by React Router

if you have more complex destinations, like here in quote list, where query parameters are involved you might be constructing very long strings and code could look like this.

history.push(`${location.pathname}?sort=${(isSortingAscending ? 'desc' : 'asc')}`);

It's readable, but it could be more readable. And that's why React Router actually allows you to use an alternative description off the destination

history.push({
      pathname: location.pathname,
      search: `?sort=${(isSortingAscending ? 'desc' : 'asc')}`
    });
  };