You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the OutboundLink component from gatsby-plugin-google-gtag I ran into an issue because the component does not forward its ref to the dom node inside.
Basic example
My exact use case was that I wanted to use a material-ui Link component and pass the OutboundLink as the actual component to be used like so:
import React from 'react';
import Link from '@material-ui/core/Link';
import { OutboundLink } from 'gatsby-plugin-google-gtag';
const ExternalLink = ({ to, ...props }) => (
<Link
component={OutboundLink}
href={to}
target="_blank"
rel="noopener noreferrer"
{...props}
/>
);
export default ExternalLink;
this throws an error because material-ui Links can only take components that can take refs and looking at the OutboundLink component shows that it cannot.
The text was updated successfully, but these errors were encountered:
Summary
When using the OutboundLink component from gatsby-plugin-google-gtag I ran into an issue because the component does not forward its ref to the dom node inside.
Basic example
My exact use case was that I wanted to use a material-ui Link component and pass the OutboundLink as the actual component to be used like so:
this throws an error because material-ui Links can only take components that can take refs and looking at the OutboundLink component shows that it cannot.
The text was updated successfully, but these errors were encountered: