Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. function createElement(type, config, ...args) {
  2. const props = Object.assign({}, config);
  3. const hasChildren = args.length > 0;
  4. props.children = hasChildren ? [].concat(...args) : [];
  5. return { type, props };
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement