172
rated 0 times
[
175]
[
3]
/ answers: 1 / hits: 7497
/ 3 Years ago, tue, january 12, 2021, 12:00:00
Hello guys what should be the type of Source
and Style
The source is going to contain the image file location. Something like this
source = require('../../../assets/user.png')
and style is going to have an Object of styles but not sure if I write style: Object
will be right.
export interface AvatarProps {
source?: any; <<<<< Don't want to use any
style?: any; <<<<< Don't want to use any
shape?: string;
ImageComponent?: React.ComponentType;
size?: 'tiny' | 'small' | 'medium' | 'large' | 'giant';
}
export const Avatar: FunctionComponent<AvatarProps> = ({
shape,
style,
size = 'medium',
ImageComponent,
source = require('../../../assets/user.png'),
}) => {
return (
<View>
....
</View>
);
};
More From » reactjs