Skip to content

Commit

Permalink
Add more typescript docs
Browse files Browse the repository at this point in the history
  • Loading branch information
johno committed Jul 12, 2019
1 parent 0f496e5 commit ffc896d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/advanced/typescript.md
Expand Up @@ -5,6 +5,25 @@ TODO: this feels like it’s placed weirdly.
Where could it go?
-->

Below are some basic typings to get started with:

```tsx
declare module "@mdx-js/react" {
import { ComponentType, StyleHTMLAttributes } from "react"

type MDXProps = {
children: React.ReactNode
components: { wrapper: React.ReactNode }
}
export class MDXProvider extends React.Component<MDXProps> {}
}
```

If you want to improve upon the types we would *love* a PR to
improve the developer experience for TypeScript users.

* * *

If you’re getting errors from TypeScript related to imports with an `*.mdx`
extension, create an `mdx.d.ts` file in your types directory and include it
inside your `tsconfig.json`.
Expand Down

1 comment on commit ffc896d

@swyxio
Copy link
Contributor

@swyxio swyxio commented on ffc896d Jul 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent, fast iteration

Please sign in to comment.