gatsby link styled components active code example
Example 1: install styled components in Gatsby
npm install gatsby-plugin-styled-components styled-components babel-plugin-styled-components
Also requires this addition to gatsby-config.js
module.exports = {
plugins: [`gatsby-plugin-styled-components`],
}
Example 2: how to pass props in gatsby link using styledcomponent
import { Link } from 'gatsby';
const StyledLink = styled(props => <Link {...props} />)`
color: aqua;
`;
<StyledLink to="/">
Gatsby
</StyledLink>