question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tooltip inside CardActions raises Warning: Failed prop type

See original GitHub issue

Titled case raises Warning: Failed prop type: The following properties are not supported: className. Please remove them. The issue started to appear after recent reimplementation of Tooltip component. Is it a desired behaviour? Might be connected with #12159

  • This is a v1.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

It should be possible to use Tooltip inside CardAction without above warning.

Current Behavior

         <CardActions>
            <Tooltip title="second tooltip">
              <Typography>Second text</Typography>
            </Tooltip>
          </CardActions>

causes above warning

Steps to Reproduce

Link: https://codesandbox.io/s/4j3oklzzyw

  1. Just load above example and see warning in the console.

Your Environment

Tech Version
Material-UI v1.4.1
React v16.4.1
browser any

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

8reactions
Estournetcommented, Aug 7, 2018

I’ve been experiencing the same issue inside a ListItemIcon. Wrap your Tooltip inside a React.Fragment and the warning doesn’t show up anymore.

<ListItem>
 <ListItemIcon>
    <React.Fragment>
      <Tooltip placement="top" title="Hello !">
        <Icon>done</Icon>
      </Tooltip>
    </React.Fragment>
  </ListItemIcon>
</ListItem>
2reactions
oliviertassinaricommented, Sep 23, 2018

I have been exploring the scope of the possible solution. I think that the simplest one is to make the Tooltip transparent. Basically, we can remove: https://github.com/mui-org/material-ui/blob/6245aae2dc0a34624993d094d56a2db9445dd754/packages/material-ui/src/Tooltip/Tooltip.js#L456 and forward the properties to the children: https://github.com/mui-org/material-ui/blob/6245aae2dc0a34624993d094d56a2db9445dd754/packages/material-ui/src/Tooltip/Tooltip.js#L320

Anyone wants to work on it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tooltip inside CardActions raises Warning: Failed prop type
This is a v1.x issue. I have searched the issues of this repository and believe that this is not a duplicate. Expected Behavior....
Read more >
Warning: Failed prop type: Invalid prop `children` supplied to ...
Children you are passing inside the sectect element is incorrect. Just remove value and onchange from its children as you are already ...
Read more >
material-ui/core/CHANGELOG.md - UNPKG
If no warnings are reported in the console, you are set for this first batch. ... 601, - [Tooltip] Fix flip invalid CSS...
Read more >
FormControl API - Material UI - MUI
API reference docs for the React FormControl component. Learn about the props, CSS, and other APIs of this exported module.
Read more >
CHANGELOG.old.md - mui/material-ui - Sourcegraph
[AccordionSummary] Fix false-positive propType warning with disableGeneration ... Minify error messages in production (#21214) @eps1lon.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found