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

Dropdown Title #2592

Closed
darrylmack opened this Issue Apr 25, 2017 · 8 comments

Comments

Projects
None yet
6 participants
@darrylmack

darrylmack commented Apr 25, 2017

Using the Dropdown in a component for a user menu. The 'title tag dynamically populated with this.props.userData.fullName. Everything works including have the title populated with the logged-in user's name but in the console I'm getting the following error message:
'The prop title is marked as required in DropdownButton, but its value is undefined.'

@jquense

This comment has been minimized.

Show comment
Hide comment
@jquense

jquense Apr 26, 2017

Member

Not sure what problem your raising here... PropTypes are validated when you declare the element so the title has to be included then

Member

jquense commented Apr 26, 2017

Not sure what problem your raising here... PropTypes are validated when you declare the element so the title has to be included then

@jquense jquense closed this May 17, 2017

@jimyaghi

This comment has been minimized.

Show comment
Hide comment
@jimyaghi

jimyaghi Jul 19, 2017

The issue may be a bug in PropTypes. A warning is displayed, despite a title being provided and despite the fact that react-bootstrap actually renders the dropdown correctly.

jimyaghi commented Jul 19, 2017

The issue may be a bug in PropTypes. A warning is displayed, despite a title being provided and despite the fact that react-bootstrap actually renders the dropdown correctly.

@darrylmack

This comment has been minimized.

Show comment
Hide comment
@darrylmack

darrylmack Jul 23, 2017

Yes, that's the issue. I'm providing a title via props but still getting the error message. The dropdown renders correctly.

darrylmack commented Jul 23, 2017

Yes, that's the issue. I'm providing a title via props but still getting the error message. The dropdown renders correctly.

@lindslev

This comment has been minimized.

Show comment
Hide comment
@lindslev

lindslev Sep 13, 2017

Getting the same issue.. passing title as a prop to DropdownButton but still seeing

Warning: Failed prop type: The prop 'title' is marked as required in 'Uncontrolled(Dropdown)', but its value is 'undefined' in Uncontrolled(Dropdown) (created by DropdownButton)

lindslev commented Sep 13, 2017

Getting the same issue.. passing title as a prop to DropdownButton but still seeing

Warning: Failed prop type: The prop 'title' is marked as required in 'Uncontrolled(Dropdown)', but its value is 'undefined' in Uncontrolled(Dropdown) (created by DropdownButton)

@lindslev

This comment has been minimized.

Show comment
Hide comment
@lindslev

lindslev Sep 13, 2017

Wouldn't this line https://github.com/react-bootstrap/react-bootstrap/blob/master/src/DropdownButton.js#L27 mean title is excluded from dropdownProps?

Edit: I see title isn't even defined in Dropdown's propTypes so yeah pretty confused why I'm seein' this error :(

lindslev commented Sep 13, 2017

Wouldn't this line https://github.com/react-bootstrap/react-bootstrap/blob/master/src/DropdownButton.js#L27 mean title is excluded from dropdownProps?

Edit: I see title isn't even defined in Dropdown's propTypes so yeah pretty confused why I'm seein' this error :(

@taion

This comment has been minimized.

Show comment
Hide comment
@taion

taion Sep 13, 2017

Member

@jimyaghi @darrylmack If you're setting title via React.cloneElement, you might get this warning, as React checks props at element creation time.

@lindslev <Dropdown> doesn't take a title prop and doesn't list it in propTypes: https://github.com/react-bootstrap/react-bootstrap/blob/v0.31.3/src/Dropdown.js. Not clear where that error is coming from, but it doesn't look like it's something here.

Member

taion commented Sep 13, 2017

@jimyaghi @darrylmack If you're setting title via React.cloneElement, you might get this warning, as React checks props at element creation time.

@lindslev <Dropdown> doesn't take a title prop and doesn't list it in propTypes: https://github.com/react-bootstrap/react-bootstrap/blob/v0.31.3/src/Dropdown.js. Not clear where that error is coming from, but it doesn't look like it's something here.

@lindslev

This comment has been minimized.

Show comment
Hide comment
@lindslev

lindslev Sep 13, 2017

@taion do these images help you? i'm p stumped

screen shot 2017-09-13 at 2 50 11 am

screen shot 2017-09-13 at 2 49 55 am

lindslev commented Sep 13, 2017

@taion do these images help you? i'm p stumped

screen shot 2017-09-13 at 2 50 11 am

screen shot 2017-09-13 at 2 49 55 am

@gnapse

This comment has been minimized.

Show comment
Hide comment
@gnapse

gnapse Dec 11, 2017

A different issue, but why the title is required for a DropdownButton? I think is legit to want to render a dropdown button where the button shows only the caret. And this library's DropdownButton already works ok without a title, except for the warning about the prop being required.

Right now I'm avoiding the warning altogether by giving it title="" which also renders as intended. Seems to me this prop is really not required by that component.

gnapse commented Dec 11, 2017

A different issue, but why the title is required for a DropdownButton? I think is legit to want to render a dropdown button where the button shows only the caret. And this library's DropdownButton already works ok without a title, except for the warning about the prop being required.

Right now I'm avoiding the warning altogether by giving it title="" which also renders as intended. Seems to me this prop is really not required by that component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment