Skip to content

Instantly share code, notes, and snippets.

@iofjuupasli
Created March 14, 2016 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iofjuupasli/64c0d4f448a6ee5d8bd6 to your computer and use it in GitHub Desktop.
Save iofjuupasli/64c0d4f448a6ee5d8bd6 to your computer and use it in GitHub Desktop.
// All children from new line
// bad
h('.my-class', null, h('span', null, 'Foo'));
// good
h('.my-class', null,
h('span', null,
'Foo'
)
);
// Don't use div as component name - it's default
// bad
h('div.foo', null,
h('div')
);
// good
h('.foo', null,
h('.bar')
);
// Use only static component names (for DOM elements)
// bad
h(`span.${componentClassName}`);
// good
h('span', {
className: componentClassName
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment