File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,5 @@ export type {
48
48
IPosition ,
49
49
Middleware ,
50
50
}
51
+
52
+ export { removeStyle } from './utils/handle-style'
Original file line number Diff line number Diff line change @@ -20,6 +20,26 @@ function injectStyle({
20
20
// eslint-disable-next-line @typescript-eslint/no-explicit-any
21
21
ref ?: any
22
22
} ) {
23
+ if ( ! css || typeof document === 'undefined' || injected [ type ] ) {
24
+ return
25
+ }
26
+
27
+ if (
28
+ type === 'core' &&
29
+ typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`
30
+ process ?. env ?. REACT_TOOLTIP_DISABLE_CORE_STYLES
31
+ ) {
32
+ return
33
+ }
34
+
35
+ if (
36
+ type !== 'base' &&
37
+ typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`
38
+ process ?. env ?. REACT_TOOLTIP_DISABLE_BASE_STYLES
39
+ ) {
40
+ return
41
+ }
42
+
23
43
if ( type === 'core' ) {
24
44
// eslint-disable-next-line no-param-reassign
25
45
id = REACT_TOOLTIP_CORE_STYLES_ID
@@ -31,10 +51,6 @@ function injectStyle({
31
51
}
32
52
const { insertAt } = ref
33
53
34
- if ( ! css || typeof document === 'undefined' || injected [ type ] ) {
35
- return
36
- }
37
-
38
54
if ( document . getElementById ( id ) ) {
39
55
// this should never happen because of `injected[type]`
40
56
if ( process . env . NODE_ENV !== 'production' ) {
@@ -71,6 +87,10 @@ function injectStyle({
71
87
injected [ type ] = true
72
88
}
73
89
90
+ /**
91
+ * @deprecated Use the `disableStyleInjection` tooltip prop instead.
92
+ * See https://react-tooltip.com/docs/examples/styling#disabling-reacttooltip-css
93
+ */
74
94
function removeStyle ( {
75
95
type = 'base' ,
76
96
id = REACT_TOOLTIP_BASE_STYLES_ID ,
You can’t perform that action at this time.
0 commit comments