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

fix(v2): remove hashbang when click on category #1999

Merged
merged 2 commits into from
Nov 15, 2019

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented Nov 15, 2019

Motivation

Currently, when you click on a category in the browser address bar, two characters "#!" (known as the hashbang) are added to the end of the URL. This is somewhat annoying and clogs the browser history.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  1. Click on a category to expand it.
  2. Look at the browser bar, the URL should not change

@lex111 lex111 added the pr: bug fix This PR fixes a bug in a past release. label Nov 15, 2019
@lex111 lex111 changed the title fix(v2): remove hashbang when click on collapsed item fix(v2): remove hashbang when click on category Nov 15, 2019
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Nov 15, 2019
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Nov 15, 2019

Deploy preview for docusaurus-2 ready!

Built with commit 5df7f5d

https://deploy-preview-1999--docusaurus-2.netlify.com

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Nov 15, 2019

Deploy preview for docusaurus-preview ready!

Built with commit 5df7f5d

https://deploy-preview-1999--docusaurus-preview.netlify.com

@@ -27,6 +27,11 @@ function DocSidebarItem({item, onItemClick, collapsible}) {
setCollapsed(item.collapsed);
}

const handleItemClick = useCallback(e => {
Copy link
Contributor

@yangshun yangshun Nov 15, 2019

Choose a reason for hiding this comment

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

This use of useCallback is premature optimization IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe revert it?

@yangshun yangshun merged commit 5d3b889 into facebook:master Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants