Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createElement(type, config, ...args) {
- const props = Object.assign({}, config);
- const hasChildren = args.length > 0;
- props.children = hasChildren ? [].concat(...args) : [];
- return { type, props };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement