Skip to content

Convert 20 trivial class components to functional#695

Merged
rzueger merged 1 commit intodevelopfrom
chore/convert-trivial-class-components
Apr 8, 2026
Merged

Convert 20 trivial class components to functional#695
rzueger merged 1 commit intodevelopfrom
chore/convert-trivial-class-components

Conversation

@rzueger
Copy link
Copy Markdown
Member

@rzueger rzueger commented Apr 8, 2026

Summary

  • Convert 20 PureComponent classes to functional arrow components
  • Replace withTranslation() HOC with useTranslation() hook (8 components)
  • Replace defaultProps with default parameter values (5 components)
  • Add missing children propType to DetailsBox and timeWithDate propType to MovementHeader (previously hidden by <any, any> generic)
  • Add jest.mock('react-i18next') to HomeBaseIcon test

Converted components: ValidationMessage, DetailsBox, Main, MaterialIcon, MovementField, FieldSet, ImageButton, WizardNavigation, WizardBreadcrumbs, JumpNavigation, HomeBaseIcon, Header, EntryPoints, Hints, MovementGroup, MovementDetails, Action, MovementHeader

No React.memo added — these are simple presentational components where shallow comparison overhead outweighs render cost.

Test plan

  • npm run typecheck passes
  • npm test — all 1738 tests pass, snapshots unchanged
  • Cypress E2E

Replace PureComponent classes with arrow functions, replace
withTranslation() HOC with useTranslation() hook, and replace
defaultProps with default parameter values.
@rzueger rzueger merged commit 9ac71fb into develop Apr 8, 2026
2 checks passed
@rzueger rzueger deleted the chore/convert-trivial-class-components branch April 8, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant