File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ module.exports = [
2020 } ) ,
2121 ) ;
2222 } ,
23- limit : '246kB ' ,
23+ limit : '247kB ' ,
2424 } ,
2525 {
2626 name : 'Tree shaking (just a Button)' ,
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export interface CubeIconProps
4848 BaseStyleProps {
4949 size ?: Styles [ 'fontSize' ] ;
5050 stroke ?: number ;
51- children : ReactElement ;
51+ children ? : ReactElement ;
5252}
5353
5454export const Icon = memo (
@@ -58,10 +58,12 @@ export const Icon = memo(
5858 ) {
5959 const { size, stroke, ...rest } = props ;
6060
61- const icon = cloneElement ( rest . children , {
62- size : typeof size === 'number' ? size : undefined ,
63- stroke,
64- } ) ;
61+ const icon = rest . children
62+ ? cloneElement ( rest . children , {
63+ size : typeof size === 'number' ? size : undefined ,
64+ stroke,
65+ } )
66+ : rest . children ;
6567
6668 return (
6769 < IconElement
Original file line number Diff line number Diff line change 1- import { ReactNode } from 'react' ;
1+ import { ReactElement } from 'react' ;
22
33import { CubeIconProps , Icon } from './Icon' ;
44
5- export function wrapIcon ( name : string , icon : ReactNode ) {
5+ export function wrapIcon ( name : string , icon : ReactElement ) {
66 function IconWrapper ( props : CubeIconProps ) {
77 return (
88 // use custom size to support legacy icons
You can’t perform that action at this time.
0 commit comments