Skip to content

Commit 71a760e

Browse files
committed
fix: docs breaking by process undefined
1 parent 6484365 commit 71a760e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/utils/handle-style.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,19 @@ function injectStyle({
1515
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1616
ref?: any
1717
}) {
18-
if (type === 'core' && process.env.REACT_TOOLTIP_DISABLE_CORE_STYLES) {
18+
if (
19+
type === 'core' &&
20+
typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`
21+
process?.env?.REACT_TOOLTIP_DISABLE_CORE_STYLES
22+
) {
1923
return
2024
}
2125

22-
if (type !== 'core' && process.env.REACT_TOOLTIP_DISABLE_BASE_STYLES) {
26+
if (
27+
type !== 'core' &&
28+
typeof process !== 'undefined' && // this validation prevents docs from breaking even with `process?`
29+
process?.env?.REACT_TOOLTIP_DISABLE_BASE_STYLES
30+
) {
2331
return
2432
}
2533

0 commit comments

Comments
 (0)