Skip to content

Commit

Permalink
Add __nextHasNoMarginBottom prop to resolve deprecated requirements
Browse files Browse the repository at this point in the history
WP 6.7 decided to flood the browser console with deprecation warnings for a good
 portion of the most used components.

This means to clear the console you must.
- Opt into no margin
- Provide your own margin handling for bottom margins.

Hopefully one day we can revert this!!

WordPress/gutenberg#39358
  • Loading branch information
lipemat committed Oct 18, 2024
1 parent 21f55bf commit cc22a1d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions wordpress__components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ declare module '@wordpress/components' {
help?: string | ReactNode;
className?: string;
children: ReactNode;
__nextHasNoMarginBottom?: boolean;
}

/**
Expand Down Expand Up @@ -629,6 +630,7 @@ declare module '@wordpress/components' {
className?: string,
onChange: ( currentValue: boolean ) => void;
indeterminate?: boolean;
__nextHasNoMarginBottom?: boolean;
}

/**
Expand Down Expand Up @@ -692,6 +694,7 @@ declare module '@wordpress/components' {
}>;
value?: T | null;
placeholder?: string;
__nextHasNoMarginBottom?: boolean;
}): ReactElement<any, any> | null;


Expand Down Expand Up @@ -1171,6 +1174,8 @@ declare module '@wordpress/components' {
type?: 'slider' | 'stepper';
value: number;
withInputField?: boolean;
__nextHasNoMarginBottom?: boolean;

}

/**
Expand Down Expand Up @@ -1312,6 +1317,7 @@ declare module '@wordpress/components' {
}>;
value: T;
variant?: 'default' | 'minimal';
__nextHasNoMarginBottom?: boolean;
} & Omit<SelectHTMLAttributes<{}>, 'onChange'>>, context?: any ): ReactElement<any, any> | null;


Expand All @@ -1330,6 +1336,7 @@ declare module '@wordpress/components' {
onKeyDown?: ( event: KeyboardEvent<HTMLInputElement> ) => void;
placeholder?: string;
value: string;
__nextHasNoMarginBottom?: boolean;
}

interface Shortcut extends HTMLSpanElement {
Expand Down Expand Up @@ -1383,6 +1390,7 @@ declare module '@wordpress/components' {
help?: ReactNode;
label?: ReactNode;
onChange: ( currentValue: boolean ) => void;
__nextHasNoMarginBottom?: boolean;
}

/**
Expand Down Expand Up @@ -1443,6 +1451,7 @@ declare module '@wordpress/components' {
ref?: Ref<HTMLInputElement>;
type?: 'email' | 'number' | 'password' | 'tel' | 'text' | 'search' | 'url';
value: string | number;
__nextHasNoMarginBottom?: boolean;
}

/**
Expand Down Expand Up @@ -1514,6 +1523,7 @@ declare module '@wordpress/components' {
onChange: ( currentValue: string ) => void;
rows?: number;
value: string | number;
__nextHasNoMarginBottom?: boolean;
}


Expand Down

0 comments on commit cc22a1d

Please sign in to comment.