wellcomecollection.org
wellcomecollection.org copied to clipboard
Constrain type on CardOuterComponent
What?
In making the view transitions, we conditionally toggle between the CardOuter
and CardOuterTransition
styled-components. The ElementType
I used (so's not to spend more than a day trying to fix it) is generic and a more constrained type would be more useful for catching typing issues.
Why?
Because we use TypeScript and it works best when types are as constrained as possible.
Done when
- [ ] the
CardOuterComponent
type is more constrained thanReact.ElementType