Answers for "Failed prop type: Invalid prop `children` supplied to `ForwardRef(Tooltip)`. Expected an element that can hold a ref."

0

Failed prop type: Invalid prop `children` supplied to `ForwardRef(Tooltip)`. Expected an element that can hold a ref.

// Material-UI Tooltip/FontAwesome issues

Basically, material-ui expects children to be an element as it is being referenced internally as refs.
Now in our case , we are using :
<Tooltip title="test"> <FontAwesomeIcon icon={faMicrophone} /> </Tooltip>

FontAwesomeIcon is a functional component which is not expected.

Instead use :
<Tooltip title="test"> <span> <FontAwesomeIcon icon={faMicrophone} /> </span> </Tooltip>

This will not give any warning and tooltip will show
Posted by: Guest on June-30-2021

Code answers related to "Failed prop type: Invalid prop `children` supplied to `ForwardRef(Tooltip)`. Expected an element that can hold a ref."

Browse Popular Code Answers by Language