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>;