Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 7830f3e

Browse files
committed
Update docs for [email protected]
1 parent 1344dbb commit 7830f3e

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

readme.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class App extends React.Component {
5959
unified()
6060
.use(parse)
6161
.use(remark2react)
62-
.processSync(this.state.text).contents
62+
.processSync(this.state.text).result
6363
}
6464
</div>
6565
</div>
@@ -76,6 +76,15 @@ ReactDom.render(<App />, document.getElementById('root'))
7676

7777
Transform Markdown to React.
7878

79+
Typically, [**unified**][unified] compilers return `string`.
80+
This compiler returns a `ReactElement`.
81+
When using `.process` or `.processSync`, the value at `file.result` (or when
82+
using `.stringify`, the return value), is a `ReactElement`.
83+
When using TypeScript, cast the type on your side.
84+
85+
> ℹ️ In [`[email protected]`][unified-9], the result of `.process` changed from
86+
> ~~`file.contents`~~ to `file.result`.
87+
7988
##### `options`
8089

8190
###### `options.toHast`
@@ -222,3 +231,7 @@ abide by its terms.
222231
[sanitize]: https://github.com/syntax-tree/hast-util-sanitize
223232

224233
[integrations]: https://github.com/remarkjs/remark-html#integrations
234+
235+
[unified]: https://github.com/unifiedjs/unified
236+
237+
[unified-9]: https://github.com/unifiedjs/unified/releases/tag/9.0.0

0 commit comments

Comments
 (0)