Getting Warning: Failed prop type: Invalid prop `children` supplied to `ForwardRef(Tooltip)`. Expected an element that can hold a ref. Did you accidentally use a plain function component for an element instead? For more information see https://material-ui.com/r/caveat-with-refs-guide in ForwardRef(Tooltip) (created by WithStyles(ForwardRef(Tooltip)))
I started getting the below warning after using Tooltip
Warning: Failed prop type: Invalid prop `children` supplied to `ForwardRef(Tooltip)`. Expected an element that can hold a ref. Did you accidentally use a plain function component for an element instead? For more information see https://material-ui.com/r/caveat-with-refs-guide
in ForwardRef(Tooltip) (created by WithStyles(ForwardRef(Tooltip)))
I'm using a simple Tooltip as shown below
<Tooltip title="Search">
<Link route="/search">
<SearchIcon />
</Link>
</Tooltip>
2 Answers
4 years ago by Anusha
I had encountered similar type of issue. I have used <IconButton>
instead of <Link>
which solved my issue like below.
<Tooltip title="Search">
<IconButton aria-label="search" onClick={() => Router.pushRoute(`/search`)}>
<SearchIcon />
</IconButton>
</Tooltip>
4 years ago by Divya