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

Warning message Dropdown.Toggle when I using as=a #3456

Closed
quynb93 opened this issue Feb 8, 2019 · 4 comments
Closed

Warning message Dropdown.Toggle when I using as=a #3456

quynb93 opened this issue Feb 8, 2019 · 4 comments

Comments

@quynb93
Copy link

quynb93 commented Feb 8, 2019

How to fix this warning message when I using Dropdown.Toggle, Example:

<Dropdown 
                            bsPrefix="m-dropdown"
                            alignRight={true} 
                            className="m-dropdown--inline m-dropdown--arrow">
                            <Dropdown.Toggle
                                as="a"
                                bsPrefix="m-dropdown__toggle"
                                id={`dropdown-action-${user.value._id}`}
                                className={"m-portlet__nav-link btn m-btn m-btn--link"}>
                                <i className="la la-ellipsis-h"></i>
                            </Dropdown.Toggle>

                            <Dropdown.Menu>
                                <Dropdown.Item eventKey="1">View</Dropdown.Item>
                                <Dropdown.Item eventKey="2" onClick={e => this.props.history.push("users/edit/" + user.value._id)}>Edit</Dropdown.Item>
                                <Dropdown.Item eventKey="1">Delete</Dropdown.Item>
                            </Dropdown.Menu>
                        </Dropdown>

I received this message:

index.js:2177 Warning: React does not recognize the bsPrefix prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase bsprefix instead. If you accidentally passed it from a parent component, remove it from the DOM element.
in a (created by Context.Consumer)
in ReactOverlaysDropdownToggle (created by DropdownToggle)
in DropdownToggle (created by Context.Consumer)
in ForwardRef(Bootstrap(DropdownToggle)) (at Users.js:65)
in div (created by ReactOverlaysDropdown)
in Manager (created by ReactOverlaysDropdown)
in ReactOverlaysDropdown (created by Dropdown)
in Dropdown (created by Uncontrolled(Dropdown))
in Uncontrolled(Dropdown) (at src/index.js:127)
in ForwardRef (created by Context.Consumer)
in ForwardRef(Bootstrap(undefined)) (created by Context.Consumer)
in ForwardRef(ContextTransform) (at Users.js:61)
in td (at Users.js:60)
in tr (at Users.js:39)
in tbody (at Users.js:110)
in table (created by Table)
in div (created by Table)
in Table (created by Context.Consumer)
in ForwardRef(Bootstrap(Table)) (at Users.js:99)
in div (at Users.js:98)
in div (at Users.js:88)
in div (at PageContent.js:5)
in pageContent (at Users.js:87)
in Aux (at Users.js:85)
in Users (created by Connect(Users))
in Connect(Users) (at asyncComponent.js:32)
in ReactPlaceholder (at asyncComponent.js:40)
in _class (created by Route)
in Route (at AppRouter.js:63)
in div (at _Layout.js:17)
in div (at _Layout.js:15)
in Aux (at _Layout.js:13)
in Layout (at AppRouter.js:59)
in AppRouter (at App.js:19)
in Aux (at App.js:18)
in App (created by Connect(App))
in Connect(App) (at Router.js:14)
in Route (at Router.js:11)
in RestrictedRoute (at Router.js:48)
in Aux (at Router.js:27)
in Router (created by ConnectedRouter)
in ConnectedRouter (at Router.js:26)
in PublicRoutes (created by Connect(PublicRoutes))
in Connect(PublicRoutes) (at App.js:11)
in Provider (at App.js:10)
in App (at src/index.js:8)

@taion
Copy link
Member

taion commented Feb 8, 2019

What value is getting passed down for bsPrefix there?

@felixcatto
Copy link

Have same error. Seems problem appears when you use common DOM element (div, a,...) in as prop.

@jquense
Copy link
Member

jquense commented Feb 20, 2019

Whats happening here is we add a bsPrefix to the toggle component in the DropdownButton case, in the above example that value is undefined but react is still warning because the property still exists in the props

@syncimprov
Copy link

Looks like this is fixed in beta.6? Thank you!

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

No branches or pull requests

5 participants