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(v2): Nav links activeBasePath #2303

Merged
merged 3 commits into from
Feb 21, 2020
Merged

docs(v2): Nav links activeBasePath #2303

merged 3 commits into from
Feb 21, 2020

Conversation

yangshun
Copy link
Contributor

@yangshun yangshun commented Feb 20, 2020

Motivation

Add docs for #2299. I decided to rename activeBaseRoute to activeBasePath.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Just docs...

Related PRs

#2299

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 20, 2020
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Feb 20, 2020

Deploy preview for docusaurus-2 ready!

Built with commit 16b5f10

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

const activeBaseProps =
activeBaseRoute != null
activeBasePath != null
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why not use strict comparison here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I want to check both null and undefined. != null checks for both.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would then remove this check altogether, but ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess I can do that. The other falsey values aren't valid path values anyway.

label: 'Docs',
position: 'left',
},
{to: 'blog', label: 'Blog', position: 'left'},
{to: 'blog', activeBasePath: 'blog', label: 'Blog', position: 'left'},
Copy link
Contributor

Choose a reason for hiding this comment

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

activeBasePath: 'blog'

It’s not necessary here, the Blog link is highlighted perfectly without it, isn’t it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, nope. But we never know if that might change in future. Anyway no harm adding IMO. I'm also ok with removing but I think it's good for education.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to me a "bad example" in this case, we should show that the activeBasePath option is more of a workaround that should be used wisely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will remove.

@yangshun yangshun merged commit 787b073 into master Feb 21, 2020
@yangshun yangshun added the pr: new feature This PR adds a new API or behavior. label Feb 21, 2020
@yangshun yangshun deleted the active-base-path-docs branch February 21, 2020 01:59
@lex111 lex111 added this to the v2.0.0-alpha.44 milestone Feb 23, 2020
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: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants