Skip to content

Commit

Permalink
one more fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jescalan committed Sep 14, 2020
1 parent 735fce4 commit 81ef6e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ This library exposes two functions, `renderToString` and `hydrate`, much like `r
**`renderToString`** consumes a string of MDX along with any components it utilizes in the format `{ ComponentName: ActualComponent }`. It also can optionally be passed options which are [passed directly to MDX](https://mdxjs.com/advanced/plugins), and a scope object that can be included in the mdx scope. The function returns an object that is intended to be passed into `hydrate` directly.

```ts
renderToString({
renderToString(
// Raw MDX contents as a string
source: '# hello, world',
'# hello, world',
// Optional parameters
options: {
{
// The `name` is how you will invoke the component in your MDX
components: { name: React.ComponentType },
// MDX's available options at time of writing pulled directly from
Expand All @@ -97,8 +97,8 @@ This library exposes two functions, `renderToString` and `hydrate`, much like `r
filepath: '/some/file/path',
},
scope: {},
},
})
}
)
```

Visit <https://github.com/mdx-js/mdx/blob/master/packages/mdx/index.js> for available `mdxOptions`.
Expand Down

0 comments on commit 81ef6e2

Please sign in to comment.