Skip to content

Commit

Permalink
Change the type of icon to ReactNode
Browse files Browse the repository at this point in the history
  • Loading branch information
kienstra committed Nov 2, 2022
1 parent 7b0c570 commit ecb2387
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/snackbar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Function called when dismissing the notice.
- Required: No
- Default: `() => void`

#### `icon`: `WPElement | null`
#### `icon`: `ReactNode`
The icon to render in the snackbar.
- Required: No
- Default: `null`
Expand Down
7 changes: 1 addition & 6 deletions packages/components/src/snackbar/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import type {
ReactNode,
} from 'react';

/**
* WordPress dependencies
*/
import type { WPElement } from '@wordpress/element';

export type ButtonEvent =
| KeyboardEvent< HTMLButtonElement >
| MouseEvent< HTMLButtonElement >;
Expand All @@ -27,7 +22,7 @@ export type Notice = {
id: string;
spokenMessage: string;
actions: Action[];
icon?: WPElement | null;
icon?: ReactNode;

This comment has been minimized.

Copy link
@kienstra

kienstra Nov 2, 2022

Author Contributor

Good suggestion. ReactNode can be null, so we don't need | null

onDismiss?: Function;
content: string;
isDismissible: boolean;
Expand Down

0 comments on commit ecb2387

Please sign in to comment.