fix(mobile): optimize child handling in GroupedList component
- Updated memoization of child elements in GroupedInsetListCard to depend on the children prop, improving rendering efficiency. This change enhances performance by ensuring that the component only re-renders when the children change. Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -39,7 +39,10 @@ export const GroupedOutlineDescription: FC<{
|
||||
export const GroupedInsetListCard: FC<
|
||||
PropsWithChildren & ViewProps & GroupedInsetListCardProps
|
||||
> = ({ children, className, showSeparator = true, SeparatorComponent, ...props }) => {
|
||||
const nextChildren = React.useMemo(() => React.Children.toArray(children).filter(Boolean), [])
|
||||
const nextChildren = React.useMemo(
|
||||
() => React.Children.toArray(children).filter(Boolean),
|
||||
[children],
|
||||
)
|
||||
return (
|
||||
<View
|
||||
{...props}
|
||||
|
||||
Reference in New Issue
Block a user