Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@wordpress/components] Add explicit types for children #56251

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion types/wordpress__components/panel/row.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ComponentType } from 'react';
import { ComponentType, ReactNode } from 'react';

declare namespace PanelRow {
interface Props {
children?: ReactNode;
/**
* The class that will be added with `components-panel__row`. to the
* classes of the wrapper div. If no `className` is passed only
Expand Down
4 changes: 2 additions & 2 deletions types/wordpress__components/slot-fill/context.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@wordpress/element';
import { ComponentType, Consumer as ContextConsumer } from 'react';
import { ComponentType, Consumer as ContextConsumer, ReactNode } from 'react';

export interface SlotFillContext {
registerSlot(name: string, instance: Component): void;
Expand All @@ -12,7 +12,7 @@ export interface SlotFillContext {
getFills(name: string, instance: Component): ReadonlyArray<Component & { occurrence?: number | undefined }>;
}

declare const SlotFillProvider: ComponentType;
declare const SlotFillProvider: ComponentType<{ children?: ReactNode }>;

export const Consumer: ContextConsumer<SlotFillContext>;

Expand Down
3 changes: 2 additions & 1 deletion types/wordpress__components/snackbar/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentType } from 'react';
import { ComponentType, ReactNode } from 'react';

import Notice from '../notice';

Expand All @@ -8,6 +8,7 @@ declare namespace Snackbar {
* An array of `Notice.Action` objects.
*/
actions?: readonly Notice.Action[] | undefined;
children?: ReactNode;
className?: string | undefined;
/**
* Callback to be called when the snackbar is to be removed.
Expand Down