File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 11'use client' ;
2- import React from 'react' ;
2+ import React , { useMemo } from 'react' ;
33import { Text , View } from 'react-native' ;
44import { PrimitiveIcon , UIIcon } from '@gluestack-ui/core/icon/creator' ;
55import { tva } from '@gluestack-ui/utils/nativewind-utils' ;
@@ -120,15 +120,17 @@ function Badge({
120120 className,
121121 ...props
122122} : { className ?: string } & IBadgeProps ) {
123+
124+ const contextValue = useMemo (
125+ ( ) => ( { action, variant, size } ) ,
126+ [ action , variant , size ]
127+ ) ;
128+
123129 return (
124130 < ContextView
125131 className = { badgeStyle ( { action, variant, class : className } ) }
126132 { ...props }
127- context = { {
128- action,
129- variant,
130- size,
131- } }
133+ context = { contextValue }
132134 >
133135 { children }
134136 </ ContextView >
@@ -211,4 +213,4 @@ Badge.displayName = 'Badge';
211213BadgeText . displayName = 'BadgeText' ;
212214BadgeIcon . displayName = 'BadgeIcon' ;
213215
214- export { Badge , BadgeIcon , BadgeText } ;
216+ export { Badge , BadgeIcon , BadgeText } ;
You can’t perform that action at this time.
0 commit comments