Skip to content

Commit

Permalink
Prevent an error from colors possibly being undefined
Browse files Browse the repository at this point in the history
Types of property 'colors' are incompatible.
  Type 'Colors | undefined' is not assignable to type '(Color | MultipleColors)[]'.
    Type 'undefined' is not assignable to type '(Color | MultipleColors)[]'.
  • Loading branch information
kienstra committed Oct 12, 2022
1 parent 4a602dd commit 7fe648e
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,22 @@ const BorderControlDropdown = (
/>
</HStack>
) : undefined }
<ColorPalette
className={ popoverContentClassName }
value={ color }
onChange={ onColorChange }
{ ...{ colors, disableCustomColors } }
__experimentalHasMultipleOrigins={
__experimentalHasMultipleOrigins
}
__experimentalIsRenderedInSidebar={
__experimentalIsRenderedInSidebar
}
clearable={ false }
enableAlpha={ enableAlpha }
/>
{ colors ? (
<ColorPalette
className={ popoverContentClassName }
value={ color }
onChange={ onColorChange }
{ ...{ colors, disableCustomColors } }
__experimentalHasMultipleOrigins={
__experimentalHasMultipleOrigins
}
__experimentalIsRenderedInSidebar={
__experimentalIsRenderedInSidebar
}
clearable={ false }
enableAlpha={ enableAlpha }
/>
) : undefined }
{ enableStyle && (
<BorderControlStylePicker
label={ __( 'Style' ) }
Expand Down

0 comments on commit 7fe648e

Please sign in to comment.