feat: allow passing false as PayloadComponent which signals that the component should not be rendered (#7682)

If it's undefined/null => Fallback Component may be rendered
If it's false => No component should be rendered - as if an empty
component was passed in

This ensures that the user does not have to install `@payloadcms/ui`
anymore, which previously exported an empty component to be used in
component paths
This commit is contained in:
Alessio Gravili
2024-08-14 18:31:58 -04:00
committed by GitHub
parent cb7fa00a6f
commit 49a2d70fbb
15 changed files with 41 additions and 18 deletions

View File

@@ -3,5 +3,5 @@ import type { RichTextCustomElement } from '../../../types.js'
export const textAlign: RichTextCustomElement = {
name: 'alignment',
Button: '@payloadcms/richtext-slate/client#TextAlignElementButton',
Element: '@payloadcms/ui/shared#emptyComponent',
Element: false,
}