Skip to content

Commit d47d212

Browse files
committed
feat: allow composition
1 parent eb3459f commit d47d212

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.storybook/jsx.stories.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ const Button = jsx('button', {
3535
}
3636
});
3737

38+
const ButtonYellow = jsx(Button, {
39+
color: 'yellow'
40+
});
41+
3842
storiesOf('jsx()', module)
3943
.add('Default', () =>
4044
h(RedBorder, null, 'Hello world')
@@ -50,3 +54,8 @@ storiesOf('jsx()', module)
5054
h(Button, null, 'Click me!')
5155
)
5256
)
57+
.add('Composition', () =>
58+
h(Block, null,
59+
h(ButtonYellow, null, 'Click me!')
60+
)
61+
)

addon/extend.js

Whitespace-only changes.

addon/jsx.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ exports.addon = function (renderer) {
1515
var className;
1616
var isElement = typeof fn === 'string';
1717

18-
if (!block && !isElement)
19-
block = fn.displayName || fn.name;
20-
2118
var Component = function (props) {
2219
if (!className) {
2320
className = renderer.rule(styles, block);

0 commit comments

Comments
 (0)