1. import { ELEMENT_TEXT } from './constants';
    2. function createElement(type, config, ...children) {
    3. delete config.__self;
    4. delete config.__source;
    5. return {
    6. type,
    7. props: {
    8. ...config,
    9. children: children.map(
    10. child => typeof child === "object" ?
    11. child :
    12. { type: ELEMENT_TEXT, props: { text: child, children: [] } })
    13. }
    14. }
    15. }
    16. let React = {
    17. createElement
    18. }
    19. export default React;