Skip to content

Commit b6e9a1c

Browse files
authored
fix(compability): add polyfill and change styles (ReactTooltip#706)
1 parent 6d702c8 commit b6e9a1c

File tree

5 files changed

+82
-295
lines changed

5 files changed

+82
-295
lines changed

.babelrc

+8-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
"@babel/plugin-proposal-json-strings"
88
],
99
"presets": [
10-
"@babel/preset-env",
10+
[
11+
"@babel/preset-env",
12+
{
13+
"useBuiltIns": "entry",
14+
"corejs": "3.12"
15+
}
16+
],
1117
"@babel/preset-react"
1218
]
13-
}
19+
}

bin/transferSass.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const sass = require('node-sass');
1+
const sass = require('sass');
22
const fs = require('fs');
33
const path = require('path');
44

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
"chai-spies": "^1.0.0",
9090
"commitizen": "2.9.6",
9191
"concurrently": "^2.1.0",
92+
"core-js": "^3.12.1",
9293
"cpy-cli": "^3.1.1",
9394
"cz-conventional-changelog": "^3.1.0",
9495
"enzyme": "^2.3.0",
@@ -114,7 +115,6 @@
114115
"mocha": "^8.1.3",
115116
"mocha-each": "^2.0.1",
116117
"mocha-jsdom": "^2.0.0",
117-
"node-sass": "^4.13.1",
118118
"npm-run-all": "^4.1.5",
119119
"postcss-nested": "^4.2.1",
120120
"postcss-simple-vars": "^5.0.2",
@@ -132,6 +132,7 @@
132132
"rollup-plugin-sass": "^1.2.2",
133133
"rollup-plugin-stylelint": "1.0.0",
134134
"rollup-plugin-url": "^3.0.1",
135+
"sass": "^1.34.0",
135136
"semantic-release": "^17.0.4",
136137
"snazzy": "^2.0.1",
137138
"standard": "^5.2.2",

src/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import { generateUUID } from './utils/uuid';
2222
import baseCss from './index.scss';
2323
import { generateTooltipStyle } from './decorators/styler';
2424

25+
/* Polyfill */
26+
import 'core-js/modules/es.array.find';
27+
2528
@staticMethods
2629
@windowListener
2730
@customEvent
@@ -191,6 +194,7 @@ class ReactTooltip extends React.Component {
191194
switch (parentNode.constructor.name) {
192195
case 'Document':
193196
case 'HTMLDocument':
197+
case undefined:
194198
domRoot = parentNode.head;
195199
break;
196200
case 'ShadowRoot':

0 commit comments

Comments
 (0)