templates: allow to pass resource={null} to Media component (#11228)
The `Media` component has an optional property `resource` so we can skip that property. As in payload `required: false` types are generated like `media?: Media | string | null`, it also makes sense to allow `null` as a `resource` value. Fixes https://github.com/payloadcms/payload/issues/11200
This commit is contained in:
@@ -13,7 +13,7 @@ export interface Props {
|
||||
onLoad?: () => void
|
||||
priority?: boolean // for NextImage only
|
||||
ref?: Ref<HTMLImageElement | HTMLVideoElement | null>
|
||||
resource?: MediaType | string | number // for Payload media
|
||||
resource?: MediaType | string | number | null // for Payload media
|
||||
size?: string // for NextImage only
|
||||
src?: StaticImageData // for static media
|
||||
videoClassName?: string
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface Props {
|
||||
loading?: 'lazy' | 'eager' // for NextImage only
|
||||
priority?: boolean // for NextImage only
|
||||
ref?: Ref<HTMLImageElement | HTMLVideoElement | null>
|
||||
resource?: MediaType | string | number // for Payload media
|
||||
resource?: MediaType | string | number | null // for Payload media
|
||||
size?: string // for NextImage only
|
||||
src?: StaticImageData // for static media
|
||||
videoClassName?: string
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface Props {
|
||||
loading?: 'lazy' | 'eager' // for NextImage only
|
||||
priority?: boolean // for NextImage only
|
||||
ref?: Ref<HTMLImageElement | HTMLVideoElement | null>
|
||||
resource?: MediaType | string | number // for Payload media
|
||||
resource?: MediaType | string | number | null // for Payload media
|
||||
size?: string // for NextImage only
|
||||
src?: StaticImageData // for static media
|
||||
videoClassName?: string
|
||||
|
||||
Reference in New Issue
Block a user