79417254

Date: 2025-02-06 08:52:47
Score: 1
Natty:
Report link

You can't directly access dynamic properties in TypeScript types. You need to use generics to achieve this.

type GetPropertyType<T, K extends keyof T> = T[K];
type LayerPropType = GetPropertyType<WMSLayerProps, typeof tagName>;
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: shanshiliu