Use a helper function for React "inlining"

Either due to lower parsing costs or better type inference, this seems
to perform better than direct object inlining. (All along, the main win
was skipping a loop through props, not avoiding a function call.)
This commit is contained in:
Ben Alpert
2015-11-10 21:10:06 -08:00
parent 3f41023e02
commit 3cad287233
19 changed files with 68 additions and 204 deletions

View File

@@ -1,18 +1,4 @@
({
$$typeof: babelHelpers.typeofReactElement,
type: "div",
key: null,
ref: null,
props: {
className: "foo",
children: [bar, {
$$typeof: babelHelpers.typeofReactElement,
type: Baz,
key: "baz",
ref: null,
props: Baz.defaultProps,
_owner: null
}]
},
_owner: null
});
babelHelpers.createRawReactElement("div", null, {
className: "foo",
children: [bar, babelHelpers.createRawReactElement(Baz, "baz", Baz.defaultProps)]
});