Skip to content

Commit

Permalink
feat: allow composition
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 14, 2018
1 parent eb3459f commit d47d212
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .storybook/jsx.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const Button = jsx('button', {
}
});

const ButtonYellow = jsx(Button, {
color: 'yellow'
});

storiesOf('jsx()', module)
.add('Default', () =>
h(RedBorder, null, 'Hello world')
Expand All @@ -50,3 +54,8 @@ storiesOf('jsx()', module)
h(Button, null, 'Click me!')
)
)
.add('Composition', () =>
h(Block, null,
h(ButtonYellow, null, 'Click me!')
)
)
Empty file removed addon/extend.js
Empty file.
3 changes: 0 additions & 3 deletions addon/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ exports.addon = function (renderer) {
var className;
var isElement = typeof fn === 'string';

if (!block && !isElement)
block = fn.displayName || fn.name;

var Component = function (props) {
if (!className) {
className = renderer.rule(styles, block);
Expand Down

0 comments on commit d47d212

Please sign in to comment.