Skip to content

[docs] Fix failing client-side navigation for /api routes#28356

Merged
eps1lon merged 2 commits intomui:masterfrom
eps1lon:docs/fix-api-navigation
Sep 15, 2021
Merged

[docs] Fix failing client-side navigation for /api routes#28356
eps1lon merged 2 commits intomui:masterfrom
eps1lon:docs/fix-api-navigation

Conversation

@eps1lon
Copy link
Member

@eps1lon eps1lon commented Sep 15, 2021

Next.js previously fell back to basic URL navigation (opposed to client-side routing) for links to /api routes that were rendered via markdown.

Compare clicking on the "InputBase" link in "Props of the InputBase component are also available." on https://613f2e53d5823400073263e4--material-ui.netlify.app/api/outlined-input/ vs https://deploy-preview-28356--material-ui.netlify.app//api/outlined-input/

I previously thought rewrites was just not working for client-side navigation (#23586). Turns out it's just bugged when the rewrite doesn't have a trailing slash with trailingSlash: true (vercel/next.js#25673, vercel/next.js#25104, vercel/next.js#20984).

We can probably revert most #23586 but I'm not sure how the data-grid api-docs rewrites work so I'm rather not touch it.

@eps1lon eps1lon added type: bug It doesn't behave as expected. docs Improvements or additions to the documentation. labels Sep 15, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Sep 15, 2021

No bundle size changes

Generated by 🚫 dangerJS against 33b1bc9

@eps1lon eps1lon marked this pull request as ready for review September 15, 2021 12:17
@eps1lon eps1lon merged commit 5a0e7d9 into mui:master Sep 15, 2021
@eps1lon eps1lon deleted the docs/fix-api-navigation branch September 15, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants