Fix TypeScript error in SwipeTabs TouchList type
Use React.TouchList and React.Touch types instead of native DOM types to resolve type compatibility issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,10 +28,10 @@ const EDGE_RESISTANCE = 0.35;
|
|||||||
const DEFAULT_THRESHOLD = 0.2;
|
const DEFAULT_THRESHOLD = 0.2;
|
||||||
const DEFAULT_RENDER_WINDOW = 1;
|
const DEFAULT_RENDER_WINDOW = 1;
|
||||||
|
|
||||||
const findTouchById = (touches: TouchList, id: number) => {
|
const findTouchById = (touches: React.TouchList, id: number): React.Touch | null => {
|
||||||
for (let i = 0; i < touches.length; i += 1) {
|
for (let i = 0; i < touches.length; i += 1) {
|
||||||
const touch = touches[i];
|
const touch = touches.item(i);
|
||||||
if (touch.identifier === id) {
|
if (touch && touch.identifier === id) {
|
||||||
return touch;
|
return touch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user