Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2fa8bc9

Browse files
committed
add render wrapper
1 parent 54835cc commit 2fa8bc9

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,27 @@ render() {
9393
named slots:
9494

9595
```jsx
96-
<MyComponent>
97-
<header slot="header">header</header>
98-
<footer slot="footer">footer</footer>
99-
</MyComponent>
96+
render() {
97+
return (
98+
<MyComponent>
99+
<header slot="header">header</header>
100+
<footer slot="footer">footer</footer>
101+
</MyComponent>
102+
)
103+
}
100104
```
101105

102106
scoped slots:
103107

104108
```jsx
105-
const scopedSlots = {
106-
header: () => <header>header</header>,
107-
footer: () => <footer>footer</footer>
108-
}
109+
render() {
110+
const scopedSlots = {
111+
header: () => <header>header</header>,
112+
footer: () => <footer>footer</footer>
113+
}
109114

110-
<MyComponent scopedSlots={scopedSlots} />
115+
return <MyComponent scopedSlots={scopedSlots} />
116+
}
111117
```
112118

113119
### Directives

0 commit comments

Comments
 (0)