Skip to content

Commit 95ba33e

Browse files
authoredJul 12, 2024··
Add notes on how to type props and components
Closes GH-2510. Reviewed-by: Titus Wormer <tituswormer@gmail.com>
1 parent 044e8b2 commit 95ba33e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

Diff for: ‎docs/docs/using-mdx.mdx

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import {Note} from '../_component/note.jsx'
2+
13
export const info = {
24
author: [
35
{github: 'wooorm', name: 'Titus Wormer', twitter: 'wooorm'}
@@ -206,6 +208,13 @@ console.log(React.createElement(Example, {name: 'Venus', year: 2021}))
206208
console.log(<Example name="Mars" year={2022} />)
207209
```
208210
211+
<Note type="info">
212+
**Note**:
213+
Users of the MDX VS Code extension can add type
214+
checking of `props` with a JSDoc comment.
215+
See [`mdx-js/mdx-analyzer`][mdx-analyzer] for more info.
216+
</Note>
217+
209218
### Components
210219
211220
There is one special prop: `components`.
@@ -383,6 +392,13 @@ because in JSX syntax `a` is a literal tag name.
383392
The third link (`#charlie`) is dashed and tomato,
384393
as in JSX syntax `Link` is a reference.
385394
395+
<Note type="info">
396+
**Note**:
397+
Users of the MDX VS Code extension can add type
398+
checking of provided and passed components with a JSDoc comment.
399+
See [`mdx-js/mdx-analyzer`][mdx-analyzer] for more info.
400+
</Note>
401+
386402
### Layout
387403
388404
There is one special component: the layout.
@@ -592,6 +608,8 @@ providers: pass components explicitly.
592608
593609
[what]: /docs/what-is-mdx/
594610
611+
[mdx-analyzer]: https://github.com/mdx-js/mdx-analyzer
612+
595613
[mdx-react]: /packages/react/
596614
597615
[mdx-preact]: /packages/preact/

0 commit comments

Comments
 (0)
Please sign in to comment.