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:
Innei
2025-04-08 20:40:48 +08:00
parent b1c356fcd4
commit 63b39a08c9
@@ -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}