Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Fix /api client-side routing #23586

Merged
merged 6 commits into from
Nov 18, 2020

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 17, 2020

Deploy with all locales (for routing testing): https://5fb41a5e69a49d000885d0cb--material-ui.netlify.app/

Currently navigating to /api pages from within the docs triggers a full page reload.

I assumed that rewrites was working for client-side routing since that was nextjs maintainers explicitly told us. But rewrites don't have any effect on next export. We can achieve the same effect with Link#as it seems.

Used the opportunity to type-check the parts that I worked on.

@eps1lon eps1lon added bug 🐛 Something doesn't work docs Improvements or additions to the documentation labels Nov 17, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Nov 17, 2020

Details of bundle changes

Generated by 🚫 dangerJS against 7345db8

Comment on lines +193 to +195
.map((page) => {
return { ...page, linkProps: { as: page.pathname.replace(/^\/api-docs/, '/api') } };
}),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants