It would be cool if Gatsby exported some more types to make working with page props more type safe. Ideally we could import the props that gatsby passes to page components. Something like:
import * as React from "react";
import {PageProps} from 'gatsby';
export class MyPage extends React.PureComponent<PageProps, {}> {
render() {
return (
this.props.location
);
}
}
Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue.
this would be nice
i agree this would be nice. someone should reopen this and/or add the types
this still does not exist right?
Please re-open!
I went through gatsby and reach router exported types and interfaces but there is none that would cover the real type of page props, which is:

It would be cool to have it typed..
Try to use this type: ReplaceComponentRendererArgs['props']
Like this:
const Page: React.FC<ReplaceComponentRendererArgs['props']> = ({ location }) => {
return (<div>{location.href}</div>)
}
}
Agree that this would be v nice 馃憣
I don't know if this is cheeky or not but I've reopened the issue since obviously several people want this and it doesn't appear to be stale
Oh, nevermind. Appears gatsby exports PageProps which covers it? Reclosing.
@seaneking: nice find, but is this documented somewhere? I don't see it at https://www.gatsbyjs.org/docs/location-data-from-props/ for example.
AFAIK Gatsby鈥檚 typescript types aren鈥檛 documented anywhere? I just discovered it by playing around with VSCode鈥檚 intellisense importing
Most helpful comment
Oh, nevermind. Appears gatsby exports
PagePropswhich covers it? Reclosing.