diff --git a/packages/react-dom-factories/index.js b/packages/react-dom-factories/index.js index ceca5fb48c..3c28f9da27 100644 --- a/packages/react-dom-factories/index.js +++ b/packages/react-dom-factories/index.js @@ -37,7 +37,15 @@ /** * Create a factory that creates HTML tag elements. */ - var createDOMFactory = React.createFactory; + function createDOMFactory(type) { + var factory = React.createElement.bind(null, type); + // Expose the type on the factory and the prototype so that it can be + // easily accessed on elements. E.g. `.type === Foo`. + // This should not be named `constructor` since this may not be the function + // that created the element, and it may not even be a constructor. + factory.type = type; + return factory; + }; /** * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.