website
website copied to clipboard
Migrate BenefitsSection from JSX to TypeScript
Description
The BenefitsSection.jsx component is currently written in plain JSX. Converting it to TypeScript (.tsx) would improve type safety and code maintainability.
Files to Update
- Rename:
src/components/BenefitsSection.jsx→src/components/BenefitsSection.tsx - Update any imports in other files if needed
Task
- Rename the file from
.jsxto.tsx - Add proper TypeScript types for:
- The benefits array items
- Component props (if any)
- Any other variables that could benefit from typing
- Test that the component still renders correctly
Example Type Definition
interface Benefit {
title: string;
description: string;
icon: React.ReactElement;
}
const benefits: Benefit[] = [
// ... benefits array
];
Acceptance Criteria
- [ ] File is renamed to .tsx
- [ ] Proper TypeScript types are added
- [ ] No TypeScript errors
- [ ] Component functions exactly as before
- [ ] All imports are updated if needed
Resources
Great way to learn TypeScript with React!