Skip to content

Commit e6154a7

Browse files
committed
fix: keep React 18 (portos-ai-toolkit requires it), fix type resolution
- Revert React 19 / react-leaflet 5 (portos-ai-toolkit@0.8.0 needs ^18.3.1) - Pin @types/express-serve-static-core@~5.0.7 to avoid breaking ParamsDictionary change - Move @testing-library/react to client workspace to prevent React duplication - Revert React 19-specific code changes (JSX namespace, useRef, event types)
1 parent f5c8206 commit e6154a7

8 files changed

Lines changed: 1250 additions & 769 deletions

File tree

client/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,21 @@
1313
"leaflet": "^1.9.4",
1414
"lucide-react": "^0.577.0",
1515
"portos-ai-toolkit": "^0.8.0",
16-
"react": "^19.2.4",
17-
"react-dom": "^19.2.4",
16+
"react": "^18.3.1",
17+
"react-dom": "^18.3.1",
1818
"react-hot-toast": "^2.6.0",
19-
"react-leaflet": "^5.0.0",
19+
"react-leaflet": "^4.2.1",
2020
"react-router-dom": "^7.13.1",
2121
"socket.io-client": "^4.8.3",
2222
"zustand": "^5.0.11"
2323
},
2424
"devDependencies": {
25+
"@testing-library/react": "^16.3.2",
2526
"@tailwindcss/vite": "^4.2.1",
2627
"@types/d3": "^7.4.3",
2728
"@types/leaflet": "^1.9.21",
28-
"@types/react": "^19.2.14",
29-
"@types/react-dom": "^19.2.3",
29+
"@types/react": "^18.3.28",
30+
"@types/react-dom": "^18.3.7",
3031
"@vitejs/plugin-react": "^5.1.4",
3132
"tailwindcss": "^4.2.1",
3233
"typescript": "^5.7.2",

client/src/components/ai/AiDiscoveryModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect } from 'react';
1+
import { useState, useEffect } from 'react';
22
import { X, Sparkles, Check, Loader2, ChevronDown, ChevronUp, ThumbsDown } from 'lucide-react';
33
import { Link } from 'react-router-dom';
44
import { api } from '../../services/api';
@@ -372,7 +372,7 @@ export function AiDiscoveryModal({ dbId, onClose, onComplete }: AiDiscoveryModal
372372
<div className="flex items-center gap-2 flex-wrap">
373373
<Link
374374
to={`/person/${dbId}/${candidate.personId}`}
375-
onClick={(e: React.MouseEvent) => e.stopPropagation()}
375+
onClick={e => e.stopPropagation()}
376376
className="font-medium text-app-text hover:text-app-accent transition-colors"
377377
>
378378
{candidate.name}

client/src/components/ancestry-tree/ConnectionLine.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from 'react';
2-
31
interface ConnectionLineProps {
42
x1: number;
53
y1: number;
@@ -77,7 +75,7 @@ export function FamilyConnection({
7775
const targetX = fatherX ?? motherX ?? sourceX;
7876
const midX = sourceX + (targetX - sourceX) / 2;
7977

80-
const paths: React.JSX.Element[] = [];
78+
const paths: JSX.Element[] = [];
8179

8280
// Draw horizontal line from source to mid
8381
paths.push(

client/src/components/ancestry-tree/FamilyUnitCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { useRef, useEffect, useState } from 'react';
21
import type { AncestryFamilyUnit } from '@fsf/shared';
32
import { PersonCard } from './PersonCard';
3+
import { useRef, useEffect, useState } from 'react';
44

55
interface FamilyUnitCardProps {
66
unit: AncestryFamilyUnit;
@@ -9,7 +9,7 @@ interface FamilyUnitCardProps {
99
onExpandMother?: () => void;
1010
loadingFather?: boolean;
1111
loadingMother?: boolean;
12-
renderParentUnits: (units: AncestryFamilyUnit[], depth: number) => React.JSX.Element;
12+
renderParentUnits: (units: AncestryFamilyUnit[], depth: number) => JSX.Element;
1313
depth: number;
1414
}
1515

client/src/components/ui/CopyButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface CopyButtonProps {
1111

1212
export function CopyButton({ text, label = 'Copied!', size = 14, className = '' }: CopyButtonProps) {
1313
const [copied, setCopied] = useState(false);
14-
const timeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined);
14+
const timeoutRef = useRef<ReturnType<typeof setTimeout>>();
1515

1616
useEffect(() => {
1717
return () => clearTimeout(timeoutRef.current);

0 commit comments

Comments
 (0)