Skip to content

Commit e0871c9

Browse files
committed
Include $$typeof on inlined React elements
See facebook/react#4832.
1 parent 436ba9b commit e0871c9

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

packages/babel/src/transformation/file/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export default class File {
9292
"temporal-undefined",
9393
"temporal-assert-defined",
9494
"self-global",
95+
"typeof-react-element",
9596
"default-props",
9697
"instanceof",
9798

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element')) || 0xeac7

packages/babel/src/transformation/transformers/optimisation/react.inline-elements.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export var visitor = {
6161
}
6262

6363
// metadata
64+
pushElemProp("$$typeof", file.addHelper("typeof-react-element"));
6465
pushElemProp("type", type);
6566
pushElemProp("ref", t.literal(null));
6667

0 commit comments

Comments
 (0)