Skip to content

Commit 12d7b1b

Browse files
committed
fix: ensure $$typeof exists
otherwise in react@<16.3 this may detect fals-positives as the detected react symbols are `undefined`
1 parent 123e7f9 commit 12d7b1b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

.size-snapshot.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"dist/react-render-callback.umd.js": {
3-
"bundled": 3213,
4-
"minified": 1336,
5-
"gzipped": 616
3+
"bundled": 3199,
4+
"minified": 1327,
5+
"gzipped": 612
66
},
77
"dist/react-render-callback.esm.js": {
8-
"bundled": 2502,
9-
"minified": 1398,
10-
"gzipped": 595,
8+
"bundled": 2488,
9+
"minified": 1389,
10+
"gzipped": 591,
1111
"treeshaked": {
1212
"rollup": {
1313
"code": 246,
@@ -19,13 +19,13 @@
1919
}
2020
},
2121
"dist/react-render-callback.cjs.js": {
22-
"bundled": 2639,
23-
"minified": 1497,
24-
"gzipped": 628
22+
"bundled": 2625,
23+
"minified": 1488,
24+
"gzipped": 624
2525
},
2626
"dist/react-render-callback.umd.min.js": {
27-
"bundled": 3246,
28-
"minified": 1322,
29-
"gzipped": 604
27+
"bundled": 3232,
28+
"minified": 1315,
29+
"gzipped": 603
3030
}
3131
}

src/internal/isReactComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default renderable => {
2121

2222
return (
2323
type === 'object' &&
24-
renderable.$$typeof !== undefined &&
24+
renderable.$$typeof &&
2525
(renderable.$$typeof === REACT_PROVIDER_TYPE ||
2626
renderable.$$typeof === REACT_CONTEXT_TYPE ||
2727
renderable.$$typeof === REACT_FORWARD_REF_TYPE)

0 commit comments

Comments
 (0)