@akpekig
Posted
Functionally, your solution is perfect!
In terms of code, I do think there's a bit of code smell as a result of not really using React or Typescript to their fullest potential. In src/components/SignUp/Info.tsx
, three elements are repeated instead of interated using a map or loop function. In src/components/SignUp/Form.tsx
, you allow the pages context to be potentially null instead of writing some try-catch or conditional to make sure it always exists. I understand this was likely done to get around Typescript errors, but Typescript errors aren't meant to be gotten around like some kind of bug; they're a tool to help you spot where such validation is necessary.
I think the best use of these frameworks appears in src/components/UI/Button.tsx
. It's the perfect combination of typing props and componentisation.
Marked as helpful