import React , { useMemo } from 'react' ; import { Text } from 'react-native' ; import { useThemedStyle , useOverrideComponent } from '../../hooks' ; import { DEFAULT_SIZE , ICON_SETS } from './constants' ; import { stylesCreator } from './styles' ; import type { IconProps } from './types' ; const Icon = ( { overrides , name , size = DEFAULT_SIZE , color , $style , } ) => { const iconChar = useMemo ( ( ) => ICON_SETS [ name ] , [ name ] ) ; const styles = useThemedStyle ( stylesCreator , size , color ) ; const [ RootView , RootViewProps ] = useOverrideComponent ( Text , [ styles . container , $style ] , overrides ?. container ) ; return < RootView { ... RootViewProps } > { iconChar } < /RootView>; } ; export default Icon ;