Skip to content

Commit a01c683

Browse files
committed
fix: support react 19 on web
1 parent 48b43b8 commit a01c683

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

package/src/RNCSliderNativeComponent.web.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//@ts-ignore
2-
import ReactDOM from 'react-dom';
31
import React, {RefObject, useCallback} from 'react';
42
import {
53
Animated,
@@ -76,6 +74,9 @@ const RCTSliderWebComponent = React.forwardRef(
7674
}: Props,
7775
forwardedRef: any,
7876
) => {
77+
console.log('maximum value', maximumValue);
78+
console.log('step', step);
79+
7980
const containerSize = React.useRef({width: 0, height: 0});
8081
const containerPositionX = React.useRef(0);
8182
const containerRef = forwardedRef || React.createRef();
@@ -259,10 +260,9 @@ const RCTSliderWebComponent = React.forwardRef(
259260
}, [maximumValue, minimumValue, step]);
260261

261262
const updateContainerPositionX = () => {
262-
//@ts-ignore
263-
const positionX = ReactDOM.findDOMNode(
264-
(containerRef as RefObject<any>).current,
265-
).getBoundingClientRect()?.x;
263+
const positionX = (
264+
containerRef as RefObject<HTMLElement | undefined>
265+
).current?.getBoundingClientRect().x;
266266
containerPositionX.current = positionX ?? 0;
267267
};
268268

package/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
/* Language and Environment */
88
"target": "ESNext",
9-
"lib": ["ESNext"],
9+
"lib": ["ESNext", "dom"],
1010

1111
/* Modules */
1212
"module": "NodeNext",

0 commit comments

Comments
 (0)