Skip to content

Commit f8b012e

Browse files
committed
Update docs
1 parent 4d5e134 commit f8b012e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* @param {unknown} type
2121
* Element type: `Fragment` symbol, tag name (`string`), component.
2222
* @param {Props} props
23-
* Element props and also includes `children`.
23+
* Element props, `children`, and maybe `node`.
2424
* @param {string | undefined} key
2525
* Dynamicly generated key to use.
2626
* @returns {JSX.Element}
@@ -31,7 +31,7 @@
3131
* @param {unknown} type
3232
* Element type: `Fragment` symbol, tag name (`string`), component.
3333
* @param {Props} props
34-
* Element props and also includes `children`.
34+
* Element props, `children`, and maybe `node`.
3535
* @param {string | undefined} key
3636
* Dynamicly generated key to use.
3737
* @param {boolean} isStaticChildren

readme.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Create a production element (TypeScript type).
232232
* `type` (`unknown`)
233233
— element type: `Fragment` symbol, tag name (`string`), component
234234
* `props` ([`Props`][props])
235-
— element props and also includes `children`
235+
— element props, `children`, and maybe `node`
236236
* `key` (`string` or `undefined`)
237237
— dynamicly generated key to use
238238
@@ -249,7 +249,7 @@ Create a development element (TypeScript type).
249249
* `type` (`unknown`)
250250
— element type: `Fragment` symbol, tag name (`string`), component
251251
* `props` ([`Props`][props])
252-
— element props and also includes `children`
252+
— element props, `children`, and maybe `node`
253253
* `key` (`string` or `undefined`)
254254
— dynamicly generated key to use
255255
* `isStaticChildren` (`boolean`)
@@ -270,14 +270,19 @@ Properties and children (TypeScript type).
270270
###### Type
271271
272272
```ts
273+
import type {Element} from 'hast'
274+
273275
type Props = {
274-
children: Array<JSX.Element | string>
275276
[prop: string]:
277+
| Element // For `node`.
278+
| Array<JSX.Element | string | null | undefined> // For `children`.
279+
| Record<string, string> // For `style`.
276280
| string
277281
| number
278282
| boolean
279-
| Record<string, string> // For `style`.
280-
| Array<JSX.Element | string> // For `children`.
283+
| undefined
284+
children: Array<JSX.Element | string | null | undefined>
285+
node?: Element | undefined
281286
}
282287
```
283288

0 commit comments

Comments
 (0)