In PR related to the new Select component we faced a problem where the Select component must have generic props and forward ref at the same time. This led to troubles with TS types:
- type assertions had to be added in
packages/ui/src/components/form-input/index.ts and packages/ui/src/components/form-primitives/select.tsx,
- the props type of
withForm HOC was changed from ForwardRefExoticComponent<T> to ComponentType<T> | ForwardRefExoticComponent<T> in packages/ui/src/components/form-input/components/form-hoc.tsx
We need to simplify this solution.
Refs:
https://oida.dev/typescript-react-generic-forward-refs/
In PR related to the new Select component we faced a problem where the Select component must have generic props and forward ref at the same time. This led to troubles with TS types:
packages/ui/src/components/form-input/index.tsandpackages/ui/src/components/form-primitives/select.tsx,withForm HOCwas changed fromForwardRefExoticComponent<T>toComponentType<T> | ForwardRefExoticComponent<T>inpackages/ui/src/components/form-input/components/form-hoc.tsxWe need to simplify this solution.
Refs:
https://oida.dev/typescript-react-generic-forward-refs/