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

Injected props from Overlay to Tooltip results in errors #3450

Closed
msteitle opened this issue Feb 5, 2019 · 3 comments
Closed

Injected props from Overlay to Tooltip results in errors #3450

msteitle opened this issue Feb 5, 2019 · 3 comments
Labels

Comments

@msteitle
Copy link

msteitle commented Feb 5, 2019

Per the documentation:

https://react-bootstrap.github.io/components/overlays/#tooltip-examples

You can pass the Overlay injected props directly to the Tooltip component.

<Overlay target={target} show={show} placement="right">
    {props => (
    <Tooltip id="overlay-example" {...props}>
        My Tooltip
    </Tooltip>
    )}
</Overlay>

Using this exact example results in the following runtime error:

console.js?00ac:35 Warning: Received true for a non-boolean attribute show.

If you want to write it to the DOM, pass a string instead: show="true" or show={value.toString()}.
in div (created by Tooltip)
in Tooltip
in Transition (created by Fade)
in Fade (created by InnerPopper)
in InnerPopper
in Popper (created by Overlay)
in RootCloseWrapper (created by Overlay)
in WaitForContainer (created by Portal)
in Portal (created by Overlay)
in Overlay (created by WaitForContainer)
in WaitForContainer (created by ForwardRef(withContainer(Overlay)))
in Overlay (created by OverlayTooltip)

Browser: Chrome v72.0.3626.81 (Official Build) (64-bit)
OS: MacOS v10.14.2
react-bootstrap v1.0.0-beta.5
bootstrap v4.2.1
react v16.4.1

@jquense jquense added the bug label Feb 5, 2019
@Sitir
Copy link

Sitir commented Apr 2, 2019

I have noticed that too. done that and still not working

@lclement57
Copy link

lclement57 commented Apr 12, 2019

A workaround is to remove the show property when passing the props to the Tooltip since it does not belong to this object (from the API doc)

eg. with lodash

<Overlay target={target} show={show} placement="right">
    {props => (
        <Tooltip id="overlay-example" {..._.omit(props, ['show']}>
            My Tooltip
        </Tooltip>
    )}
</Overlay>

@taion
Copy link
Member

taion commented Apr 15, 2019

fixed in #3443; thanks @otanim!

@taion taion closed this as completed Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants