Include $$typeof on inlined React elements
See https://github.com/facebook/react/pull/4832.
This commit is contained in:
parent
436ba9b653
commit
1d0e68f5a1
@ -92,6 +92,7 @@ export default class File {
|
||||
"temporal-undefined",
|
||||
"temporal-assert-defined",
|
||||
"self-global",
|
||||
"typeof-react-element",
|
||||
"default-props",
|
||||
"instanceof",
|
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
(typeof Symbol === "function" && Symbol.for && Symbol.for("react.element")) || 0xeac7
|
||||
@ -61,6 +61,7 @@ export var visitor = {
|
||||
}
|
||||
|
||||
// metadata
|
||||
pushElemProp("$$typeof", file.addHelper("typeof-react-element"));
|
||||
pushElemProp("type", type);
|
||||
pushElemProp("ref", t.literal(null));
|
||||
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var _typeofReactElement = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 60103;
|
||||
|
||||
var _ref = {
|
||||
$$typeof: _typeofReactElement,
|
||||
type: "foo",
|
||||
ref: null,
|
||||
props: {},
|
||||
@ -13,6 +16,7 @@ function render() {
|
||||
function render() {
|
||||
var text = getText();
|
||||
var _ref2 = {
|
||||
$$typeof: _typeofReactElement,
|
||||
type: "foo",
|
||||
ref: null,
|
||||
props: {
|
||||
@ -23,4 +27,4 @@ function render() {
|
||||
return function () {
|
||||
return _ref2;
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: Baz,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {
|
||||
foo: "bar"
|
||||
}),
|
||||
key: null
|
||||
});
|
||||
});
|
||||
@ -1,8 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: Baz,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {}),
|
||||
key: null
|
||||
});
|
||||
});
|
||||
@ -1,10 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: "foo",
|
||||
ref: null,
|
||||
props: {
|
||||
bar: "foo"
|
||||
},
|
||||
key: null
|
||||
});
|
||||
});
|
||||
@ -1,8 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: "foo",
|
||||
ref: null,
|
||||
props: {},
|
||||
key: null
|
||||
});
|
||||
});
|
||||
@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: Foo,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Foo.defaultProps, {}),
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: Foo,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Foo.defaultProps, {
|
||||
children: [bar, {
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: Baz,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {}),
|
||||
@ -13,4 +15,4 @@
|
||||
className: "foo"
|
||||
}),
|
||||
key: null
|
||||
});
|
||||
});
|
||||
@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: "div",
|
||||
ref: null,
|
||||
props: {
|
||||
@ -8,4 +9,4 @@
|
||||
className: "foo"
|
||||
},
|
||||
key: null
|
||||
});
|
||||
});
|
||||
@ -1,10 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: "div",
|
||||
ref: null,
|
||||
props: {
|
||||
children: [bar, {
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: Baz,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {}),
|
||||
@ -13,4 +15,4 @@
|
||||
className: "foo"
|
||||
},
|
||||
key: null
|
||||
});
|
||||
});
|
||||
@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: Baz,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: Baz,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Baz.defaultProps, {}),
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: "foo",
|
||||
ref: null,
|
||||
props: {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: "foo",
|
||||
ref: null,
|
||||
props: {},
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
({
|
||||
$$typeof: babelHelpers.typeofReactElement,
|
||||
type: Foo,
|
||||
ref: null,
|
||||
props: babelHelpers.defaultProps(Foo.defaultProps, {
|
||||
bar: true
|
||||
}),
|
||||
key: null
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user