Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Sets React 19 and TypeScript coding standards for Portfolio Buddy 2 covering component patterns, hooks rules, and type conventions.
Use this skill ↓65% 87%+22 ptsof test cases passed
Passed 20 of 23 test cases with the skill, and 15 of 23 without it.
3 of 3 safety checks passed
Not used yet
// Good: Functional component with TypeScript
interface MetricsTableProps {
data: Metric[]
onSelect: (id: string) => void
}
export function MetricsTable({ data, onSelect }: MetricsTableProps) {
// Hooks at top
const [selected, setSelected] = useState<Set<string>>(new Set())
// Derived state with useMemo
const sortedData = useMemo(() =>
data.sort((a, b) => b.sharpe - a.sharpe),
[data]
)
// Event handlers with useCallback
const handleSelect = useCallback((id: string) => {
setSelected(prev => new Set(prev).add(id))
onSelect(id)
}, [onSelect])
// Render
return <div>...</div>
}
use - useMetrics, usePortfolio, useSortingSkills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.