Skip to content

Commit

Permalink
Update docs for unified@9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Mar 30, 2020
1 parent 005b4a7 commit 193e193
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"remark-cli": "^7.0.0",
"remark-preset-wooorm": "^6.0.0",
"tape": "^4.0.0",
"unified": "^8.0.0",
"unified": "^9.0.0",
"unist-builder": "^2.0.0",
"xo": "^0.28.0"
},
Expand Down
9 changes: 7 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class App extends React.Component {
<div>
<textarea value={this.state.text} onChange={this.onChange} />
<div id="preview">
{processor.processSync(this.state.text).contents}
{processor.processSync(this.state.text).result}
</div>
</div>
)
Expand Down Expand Up @@ -91,10 +91,13 @@ Yields (in `id="preview"`, on first render):

Typically, [**unified**][unified] compilers return `string`.
This compiler returns a `ReactElement`.
When using `.process` or `.processSync`, the value at `file.contents` (or when
When using `.process` or `.processSync`, the value at `file.result` (or when
using `.stringify`, the return value), is a `ReactElement`.
When using TypeScript, cast the type on your side.

> ℹ️ In [`unified@9.0.0`][unified-9], the result of `.process` changed from
> ~~`file.contents`~~ to `file.result`.
##### `options`

###### `options.createElement`
Expand Down Expand Up @@ -226,3 +229,5 @@ abide by its terms.
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

[sanitize]: https://github.com/rehypejs/rehype-sanitize

[unified-9]: https://github.com/unifiedjs/unified/releases/tag/9.0.0

0 comments on commit 193e193

Please sign in to comment.