Skip to content

Commit ca3cea6

Browse files
committed
more accurate name for react version check const
1 parent 146bff4 commit ca3cea6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/slate-react/src/components/slate.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
SlateSelectorContext,
1010
} from '../hooks/use-slate-selector'
1111
import { EDITOR_TO_ON_CHANGE } from '../utils/weak-maps'
12-
import { IS_REACT_ABOVE_VERSION_17 } from '../utils/environment'
12+
import { IS_REACT_VERSION_17_OR_ABOVE } from '../utils/environment'
1313
import { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect'
1414

1515
/**
@@ -71,7 +71,7 @@ export const Slate = (props: {
7171

7272
useIsomorphicLayoutEffect(() => {
7373
const fn = () => setIsFocused(ReactEditor.isFocused(editor))
74-
if (IS_REACT_ABOVE_VERSION_17) {
74+
if (IS_REACT_VERSION_17_OR_ABOVE) {
7575
document.addEventListener('focusin', fn)
7676
document.addEventListener('focusout', fn)
7777
return () => {

packages/slate-react/src/utils/environment.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22

3-
export const IS_REACT_ABOVE_VERSION_17 =
3+
export const IS_REACT_VERSION_17_OR_ABOVE =
44
parseInt(React.version.split('.')[0], 10) >= 17
55

66
export const IS_IOS =

0 commit comments

Comments
 (0)