Icon in Avatar doesn't work,
but the Icon Component is work when independently.
appear Waring:
Failed prop type: Invalid prop 'name' of value 'user' supplied to 'Icon',expected one of['3d-rotation ....]
I don't know what this means.
need some help.
Thank a lot.
import React from 'react';
import {View} from 'react-native';
import {Avatar,Icon} from 'react-native-elements';
export default ()=>(
//this works normally
<View>
<Icon
name='rowing'
containerStyle={{marginTop:115}}
/>
//Doesn't work, and appears waring: Failed prop type: Invalid prop 'name' of value 'user' supplied to 'Icon'
<Avatar
small
rounded
icon={{name: 'user'}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
containerStyle={{marginLeft: 20, marginTop: 115}}
/>
</View>
);

@kk412027247 By default, RNE is using MaterialIcons. If you check the list of the available icons here, you can see that user doesn't exist for MaterialIcons.
Two possibilities here:
1. Use the good icon
<Avatar
small
rounded
icon={{name: 'person'}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
containerStyle={{marginLeft: 20, marginTop: 115}}
/>
2. Specify another icon type
<Avatar
small
rounded
icon={{name: 'user', type: 'font-awesome'}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
containerStyle={{marginLeft: 20, marginTop: 115}}
/>
@xavier-villelegier
Oh~,I see, thank you very much 鉂わ笍
@xavier-villelegier Nice, it helped me too. Thank you!
Most helpful comment
@kk412027247 By default, RNE is using
MaterialIcons. If you check the list of the available icons here, you can see thatuserdoesn't exist forMaterialIcons.Two possibilities here:
1. Use the good icon
2. Specify another icon type