Skip to content

Commit 360aa2d

Browse files
committed
❌ Allow JSX elements just as you would HTML
1 parent c3ead20 commit 360aa2d

File tree

6 files changed

+1224
-28
lines changed

6 files changed

+1224
-28
lines changed

src/__fixtures__/components.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export default [
8282
- bar
8383
anObject:
8484
foo: bar
85+
NoReallyDontDoThis: !<tag:yaml.org,2002:js/function> "function(props) { return React.createElement('span', Object.assign({}, props), 'Please don\\\\'t do this.'); }"
8586
---
8687
# Markdown template with imports, static attributes and interpolations
8788
@@ -93,6 +94,10 @@ export default [
9394
9495
We're also adding a react component here: {{<Bar {...bugs} style={{ foo: 'bar' }} />}}
9596
97+
<MarkdownComponent.NoReallyDontDoThis style={{ fontWeight: 'bold' }}></MarkdownComponent.NoReallyDontDoThis>
98+
99+
<MarkdownComponent.NoReallyDontDoThis style={{ fontStyle: 'italic' }} />
100+
96101
Another cool thing you can do is use JSX **directly** - here’s an SVG element, used inline: {{ <svg style={{ display: 'inline', height: '1em' }} viewBox="0 0 304 290"><path fill="none" stroke="currentColor" strokeWidth="16" d="M2,111 h300 l-242.7,176.3 92.7,-285.3 92.7,285.3 z" /></svg> }}.
97102
`,
98103

0 commit comments

Comments
 (0)