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

Support to 'as' as prop in NavDropdown #5576

Merged
merged 9 commits into from
Jan 11, 2021

Conversation

urielgarciarivas
Copy link
Contributor

What does this PR do?
Supports as as prop in NavDropdown.

Description of tasks completed

  • Added support to prop as: PropTypes.elementType to NavDropdown component.
  • Created a test for this feature.

What is the related issue?
#5552

@urielgarciarivas
Copy link
Contributor Author

@kyletsang Should I include tests that checks every single as prop?

src/NavDropdown.tsx Outdated Show resolved Hide resolved
@kyletsang
Copy link
Member

@kyletsang Should I include tests that checks every single as prop?

A single as test would be good here

src/NavDropdown.tsx Outdated Show resolved Hide resolved
test/NavDropdownSpec.js Outdated Show resolved Hide resolved
src/NavDropdown.tsx Outdated Show resolved Hide resolved
src/NavDropdown.tsx Outdated Show resolved Hide resolved
@kyletsang kyletsang linked an issue Jan 6, 2021 that may be closed by this pull request
@kyletsang kyletsang requested a review from jquense January 6, 2021 20:44
@kyletsang
Copy link
Member

Thanks looks good to me. @jquense, double checking this with you :)

Copy link
Member

@jquense jquense left a comment

Choose a reason for hiding this comment

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

seems ok...this works because NavItem has no logic in it right? it's purely presentational? Maybe we should make a little note about that

@kyletsang
Copy link
Member

Yeah NavItem is purely presentational. Could probably shrink that to createWithBsPrefix another day.

@urielgarciarivas
Copy link
Contributor Author

So, should I comment line 83 with something like /* The following works because it's purely presentational. to-do: shrink to createWithBsPrefix */ ?

@kyletsang
Copy link
Member

So, should I comment line 83 with something like /* The following works because it's purely presentational. to-do: shrink to createWithBsPrefix */ ?

Maybe something like NavItem has no additional logic. Can set nav item class here to support "as"?

You can leave a TODO note in NavItem if you want. I was thinking of reducing some code in v5 branch later on.

@kyletsang kyletsang merged commit 93abf90 into react-bootstrap:master Jan 11, 2021
@kyletsang
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NavDropdown should support 'as' prop
3 participants