design-system-components
design-system-components copied to clipboard
support forwardref as linkComponent
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