import React, { memo } from 'react'; import Animated, { useAnimatedProps } from 'react-native-reanimated'; import { useInternal } from '../../hooks'; type IconComponentProps = { name: string; size: number; animatedProps: Partial<{ color: string }>; }; // Update iconComponent type, React.ComponentClass type IconProps = { iconComponent: any; name: string; }; const Icon = ({ iconComponent, name }: IconProps) => { const { theme } = useInternal(); let AnimatedIcon = Animated.createAnimatedComponent( iconComponent ); const iconProps = useAnimatedProps(() => { return { color: theme.value === 'light' ? 'black' : 'white', }; }, [theme]); return ; }; export default memo(Icon);