Skip to content

Commit 54b9998

Browse files
marciocloudflarethomasgauvin
authored andcommitted
added note on how to use markdown with optional params (#23421)
1 parent 84d7883 commit 54b9998

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/content/docs/style-guide/components/render.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ params:
6666
---
6767
```
6868

69+
:::caution
70+
If you use the Markdown component to format your optional parameter, you need to craft it in a special way so you don't get an `Undefined` error in pages without the optional parameter.
71+
72+
Say, for example, that your optional parameter is `instructions`. You would craft it like this:
73+
74+
`{props.instructions && <Markdown text={props.instructions} />}`
75+
76+
instead of `<Markdown text={props.instructions} />`
77+
78+
:::
79+
6980
For each of the below examples, you can open the dropdown to view the partial's content.
7081

7182
### Properties as a plain string

0 commit comments

Comments
 (0)