Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gatsby link typescript definition #2224

Merged
merged 1 commit into from
Sep 25, 2017
Merged

Conversation

iv-mexx
Copy link
Contributor

@iv-mexx iv-mexx commented Sep 25, 2017

The typescript definition only declared the props that GatsbyLink added, omitting the fact that the props of NavLink are available and valid as well.

Currently, this leads to typescript errors like

Property 'className' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<GatsbyLink> & Readonly<{ children?: ReactNode; }> ...'.

In this case, I wanted to specify a className for a GatsbyLink.

By extending the GatsbyLinkProps from NavLinkProps, Typescript knows that all the NavLinkProps are available and valid as well.

GatsbyLink uses NavLink, so NavLink props are available as well
@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit 0337a37

https://deploy-preview-2224--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

Seems legit! Thanks!

@KyleAMathews KyleAMathews merged commit d674daa into gatsbyjs:master Sep 25, 2017
@jlengstorf
Copy link
Contributor

Hiya @iv-mexx! 👋

This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here.

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (We’ve got t-shirts and hats, plus some socks that are really razzing our berries right now.)
  2. If you’re not already part of it, we just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. You’ll receive an email shortly asking you to confirm. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again! 💪💜

@iv-mexx iv-mexx deleted the patch-2 branch February 16, 2019 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants