-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[1.0] Change directory structure #802
Changes from 16 commits
ad3e387
9834943
e3c4245
1f999dd
f45a455
abb0351
3af80ea
240f5da
72e706f
d73cda5
871d31c
0c71ab9
2de4528
f4b80ed
186ed2b
c8ee94b
d3c99a3
5501d78
55d14b8
e85fe81
3d3ce81
7c58180
d232690
7d1f719
9886ac0
297100e
3df19af
5c87433
c913534
b3dd006
ad073ef
e43b022
46c6b0f
9aad264
04a8508
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,9 @@ Edge), this component will also preload code chunks on these browsers. | |
|
||
## How to use | ||
|
||
In javascript: | ||
```jsx | ||
const Link = require('gatsby-link') | ||
import Link from "gatsby-link" | ||
|
||
render () { | ||
<div> | ||
|
@@ -31,6 +32,27 @@ render () { | |
activeStyle={{ | ||
color: 'red' | ||
}} | ||
> | ||
Another page | ||
</Link> | ||
</div> | ||
} | ||
``` | ||
|
||
In typescript: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This Typescript example is superfluous. It's 95% identical to the JS one and anyone writing Typescript would know how to translate the JS example to Typescript. I can see value in maintaining code samples in different languages in the future but if we do, we'd want to put them in a toggleable interface so it's hiding the languages you're not interested in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No problem, it was just a proposition ;) |
||
```jsx | ||
import * as Link from "gatsby-link"; | ||
|
||
render () { | ||
<div> | ||
<Link | ||
to="/another-page/" | ||
activeStyle={{ | ||
color: 'red' | ||
}} | ||
> | ||
Another page | ||
</Link> | ||
</div> | ||
} | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ClassicComponentClass } from "react"; | ||
import { LinkProps } from "react-router"; | ||
|
||
type GatsbyLink = ClassicComponentClass<LinkProps>; | ||
declare const GatsbyLink: GatsbyLink; | ||
|
||
export = GatsbyLink; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some pages discussing this issue that you can link to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just my personal experience for instant, but I can search ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is what you need to do to get Hyper setup vercel/hyper#946 (comment)
Perhaps just add this to the instructions instead of this section?