Skip to content

Commit

Permalink
Block Editor: Remove 'React.Children' legacy API in 'Warning' component
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Dec 6, 2024
1 parent 9e76f0f commit a018537
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/block-editor/src/components/warning/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import clsx from 'clsx';
/**
* WordPress dependencies
*/
import { Children } from '@wordpress/element';
import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { moreVertical } from '@wordpress/icons';
Expand All @@ -20,10 +19,10 @@ function Warning( { className, actions, children, secondaryActions } ) {
{ children }
</p>

{ ( Children.count( actions ) > 0 || secondaryActions ) && (
{ ( actions?.length > 0 || secondaryActions ) && (
<div className="block-editor-warning__actions">
{ Children.count( actions ) > 0 &&
Children.map( actions, ( action, i ) => (
{ actions?.length > 0 &&
actions.map( ( action, i ) => (
<span
key={ i }
className="block-editor-warning__action"
Expand Down

0 comments on commit a018537

Please sign in to comment.