Skip to content

Commit 08dd820

Browse files
committed
chore: upgrade React and React DOM to version 19 and update type references
1 parent 78ae1ba commit 08dd820

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
"@types/classnames": "^2.2.9",
5858
"@types/jest": "^29.5.11",
5959
"@types/raf": "^3.4.0",
60-
"@types/react": "^18.0.0",
61-
"@types/react-dom": "^18.0.0",
60+
"@types/react": "^19.0.0",
61+
"@types/react-dom": "^19.0.0",
6262
"@types/warning": "^3.0.0",
6363
"antd": "^5.12.7",
6464
"dumi": "^2.2.0",
@@ -72,15 +72,15 @@
7272
"lint-staged": "^15.2.2",
7373
"prettier": "^3.0.0",
7474
"rc-test": "^7.0.9",
75-
"react": "^18.0.0",
76-
"react-dom": "^18.0.0",
75+
"react": "^19.0.0",
76+
"react-dom": "^19.0.0",
7777
"stylelint": "^16.2.1",
7878
"stylelint-config-standard-less": "^3.0.1",
7979
"typescript": "^5.3.3"
8080
},
8181
"peerDependencies": {
82-
"react": ">=16.9.0",
83-
"react-dom": ">=16.9.0"
82+
"react": ">=18.0.0",
83+
"react-dom": ">=18.0.0"
8484
},
8585
"lint-staged": {
8686
"*.{js,jsx,ts,tsx}": "eslint --fix",

src/Drawer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ const Drawer: React.FC<DrawerProps> = props => {
7070
const mergedOpen = mounted ? open : false;
7171

7272
// ============================ Focus =============================
73-
const popupRef = React.useRef<HTMLDivElement>();
73+
const popupRef = React.useRef<HTMLDivElement>(null);
7474

75-
const lastActiveRef = React.useRef<HTMLElement>();
75+
const lastActiveRef = React.useRef<HTMLElement>(null);
7676
useLayoutEffect(() => {
7777
if (mergedOpen) {
7878
lastActiveRef.current = document.activeElement as HTMLElement;

src/DrawerPopup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ function DrawerPopup(props: DrawerPopupProps, ref: React.Ref<HTMLDivElement>) {
126126
} = props;
127127

128128
// ================================ Refs ================================
129-
const panelRef = React.useRef<HTMLDivElement>();
130-
const sentinelStartRef = React.useRef<HTMLDivElement>();
131-
const sentinelEndRef = React.useRef<HTMLDivElement>();
129+
const panelRef = React.useRef<HTMLDivElement>(null);
130+
const sentinelStartRef = React.useRef<HTMLDivElement>(null);
131+
const sentinelEndRef = React.useRef<HTMLDivElement>(null);
132132

133133
React.useImperativeHandle(ref, () => panelRef.current);
134134

0 commit comments

Comments
 (0)