fix: TypeScript build error - explicitly type EdgeType array in useState
Browse filesThe build was failing because TypeScript inferred the Set as Set<string> instead of Set<EdgeType>. Adding explicit type assertion fixes the HF Spaces build.
- frontend/src/App.tsx +1 -1
frontend/src/App.tsx
CHANGED
|
@@ -99,7 +99,7 @@ function App() {
|
|
| 99 |
const [graphError, setGraphError] = useState<string | null>(null);
|
| 100 |
const [graphStats, setGraphStats] = useState<{ nodes: number; edges: number } | null>(null);
|
| 101 |
const [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);
|
| 102 |
-
const [enabledEdgeTypes, setEnabledEdgeTypes] = useState<Set<EdgeType>>(new Set(['finetune', 'quantized', 'adapter', 'merge', 'parent']));
|
| 103 |
|
| 104 |
// Threshold for using instanced rendering
|
| 105 |
const INSTANCED_THRESHOLD = 10000;
|
|
|
|
| 99 |
const [graphError, setGraphError] = useState<string | null>(null);
|
| 100 |
const [graphStats, setGraphStats] = useState<{ nodes: number; edges: number } | null>(null);
|
| 101 |
const [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);
|
| 102 |
+
const [enabledEdgeTypes, setEnabledEdgeTypes] = useState<Set<EdgeType>>(new Set(['finetune', 'quantized', 'adapter', 'merge', 'parent'] as EdgeType[]));
|
| 103 |
|
| 104 |
// Threshold for using instanced rendering
|
| 105 |
const INSTANCED_THRESHOLD = 10000;
|