Skip to content

Commit

Permalink
remove newline from template literal (hashicorp#346)
Browse files Browse the repository at this point in the history
Co-authored-by: Bryce Kalow <[email protected]>
  • Loading branch information
chrisweb and brkalow authored Feb 27, 2023
1 parent 772d213 commit 697c682
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,7 @@ import { MDXRemote } from 'next-mdx-remote/rsc'
export default function Home() {
return (
<MDXRemote
source={`
# Hello World
source={`# Hello World
This is from Server Components!
`}
Expand All @@ -468,8 +467,7 @@ export default function Home() {
// In Next.js you can also use `loading.js` for this.
<Suspense fallback={<>Loading...</>}>
<MDXRemote
source={`
# Hello World
source={`# Hello World
This is from Server Components!
`}
Expand Down Expand Up @@ -511,8 +509,7 @@ export default function Home() {
return (
<CustomMDX
// h1 now renders with `large-text` className
source={`
# Hello World
source={`# Hello World
This is from Server Components!
`}
/>
Expand All @@ -524,25 +521,24 @@ export default function Home() {

```tsx
// app/page.js
import { compileMDX } from "next-mdx-remote/rsc";
import { compileMDX } from 'next-mdx-remote/rsc'

export default async function Home() {
const {content, frontmatter} = compileMDX({
source: `
---
const { content, frontmatter } = await compileMDX({
source: `---
title: RSC Frontmatter Example
---
# Hello World
This is from Server Components!
`,
options: { parseFrontmatter: true }
options: { parseFrontmatter: true },
})
return (
<>
<h1>{frontmatter.title}</h1>
{content}
</>
);
</>
)
}
```

Expand Down

0 comments on commit 697c682

Please sign in to comment.