diff --git a/docs/pages/api/link.md b/docs/pages/api/link.md index 6a0843584dabcb..31fe46beb04efe 100644 --- a/docs/pages/api/link.md +++ b/docs/pages/api/link.md @@ -27,7 +27,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi | children * | node | | The content of the link. | | classes | object | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. | | color | 'default'
| 'error'
| 'inherit'
| 'primary'
| 'secondary'
| 'textPrimary'
| 'textSecondary'
| 'primary' | The color of the link. | -| component | elementType | 'a' | The component used for the root node. Either a string to use a DOM element or a component. | +| component | element type | 'a' | The component used for the root node. Either a string to use a DOM element or a component.
⚠️ [Needs to be able to hold a ref](/guides/composition/#caveat-with-refs). | | TypographyClasses | object | | `classes` prop applied to the [`Typography`](/api/typography/) element. | | underline | 'none'
| 'hover'
| 'always'
| 'hover' | Controls when the link should have an underline. | | variant | string | 'inherit' | Applies the theme typography styles. | diff --git a/packages/material-ui/src/Link/Link.js b/packages/material-ui/src/Link/Link.js index db71c9db020808..023ef9b52c1904 100644 --- a/packages/material-ui/src/Link/Link.js +++ b/packages/material-ui/src/Link/Link.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import clsx from 'clsx'; import capitalize from '../utils/capitalize'; import withStyles from '../styles/withStyles'; +import { elementTypeAcceptingRef } from '@material-ui/utils'; import { useIsFocusVisible } from '../utils/focusVisible'; import useForkRef from '../utils/useForkRef'; import Typography from '../Typography'; @@ -142,7 +143,7 @@ Link.propTypes = { * The component used for the root node. * Either a string to use a DOM element or a component. */ - component: PropTypes.elementType, + component: elementTypeAcceptingRef, /** * @ignore */ diff --git a/packages/material-ui/src/Link/Link.test.js b/packages/material-ui/src/Link/Link.test.js index 95eaf93d0991e0..da9711a15235c1 100644 --- a/packages/material-ui/src/Link/Link.test.js +++ b/packages/material-ui/src/Link/Link.test.js @@ -32,7 +32,6 @@ describe('', () => { inheritComponent: Typography, mount, refInstanceof: window.HTMLAnchorElement, - skip: ['componentProp'], })); it('should render children', () => {