React - 16.9
react-router and react-router-dom - 5.0.1
In the docs it is said that to prop can be a function:
A function to which current location is passed as an argument and which should return location representation as a string or as an object.
Using Link as listed in the docs:
<Link to={location => ({ ...location, pathname: "/courses" })} />
Passed function is invoked and link leads to desired url
Function is not invoked, link leads to pathname='/' + prop type warning

This isn't released yet. The documentation is ahead of where the last release is.
@timdorr, uhh... I was debugging for an hour for that, poor me. I think that is a bad developer experience to have doc mismatch with the implementation... if that is too hard, maybe add something like "added vX.X.X" could be really helpful.
We don't know the version to put there because we haven't had a release. It may show up in a minor or major release.
Unfortunately, our custom-built documentation site doesn't support versioning. We would have to switch to something like Docusaurus.
Ultimately, I'm not in charge of releases anymore, nor do I know the plans for this repo at this point. I'm just triaging issues for Michael and Ryan, and the ball is in their court to produce a new version.
Most helpful comment
@timdorr, uhh... I was debugging for an hour for that, poor me. I think that is a bad developer experience to have doc mismatch with the implementation... if that is too hard, maybe add something like "added vX.X.X" could be really helpful.