mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Use createElement rather than createFactory in react-dom-factories
This is a tiny bit more future-proof.
This commit is contained in:
+9
-1
@@ -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. `<Foo />.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.
|
||||
|
||||
Reference in New Issue
Block a user