design-system-components icon indicating copy to clipboard operation
design-system-components copied to clipboard

support forwardref as linkComponent

Open svict4 opened this issue 4 years ago • 0 comments

When trying to use Link from Gatsby instead of a normal <a> tag, we get a bunch of propType warnings and pain. This is because it is exported (from @reach/router) as a forwardRef, rather than a string or function.

I've updated to use the new PropTypes.elementType over PropType.func See facebook/prop-types#211

Where there are type checks for 'function', I've replaced them with react-is isValidElementType() - but only where it relates to linkComponent

svict4 avatar Jun 07 '20 15:06 svict4