-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathElement.njs
More file actions
41 lines (32 loc) · 805 Bytes
/
Element.njs
File metadata and controls
41 lines (32 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import Nullstack from 'nullstack'
class ClassElement extends Nullstack {
render({ prop }) {
return <div data-class-component={prop} />
}
}
function FunctionalElement({ prop }) {
return <div data-functional-component={prop} />
}
class Element extends Nullstack {
renderInnerElement({ prop }) {
return <div data-inner-component={prop} />
}
render() {
return (
<>
<element tag="b" data-tag="b">
b
</element>
<element data-tag="fragment">
<element tag="abbr" data-tag="abbr">
abbr
</element>
</element>
<element tag={this.renderInnerElement} prop />
<element tag={ClassElement} prop />
<element tag={FunctionalElement} prop />
</>
)
}
}
export default Element