Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

type for material UI icons

$
0
0

I have a component that looks like this:

type IconButtonProps = { text: string ; onClick: () => void, icon: any};export const IconButton: FunctionComponent<IconButtonProps> = ({  text,  onClick,  icon,}) => {  const classes = useStyles();  return (<Button className={classes.button}     onClick={onClick}>     {''}    {icon}     {text}</Button>  );};

and is called like this:

import SearchIcon from '@material-ui/icons/Search';<IconButton text={'Search'} icon={<SearchIcon />} onClick={()=>SearchUsers()}></IconButton>

In the props, I am using any as the icon's type. What's the correct type to use? I want to avoid using any type.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>