React native 为什么可以';我是否使用样式表道具作为材质ui组件的样式道具?
我目前正在使用以下React native 为什么可以';我是否使用样式表道具作为材质ui组件的样式道具?,react-native,material-ui,React Native,Material Ui,我目前正在使用以下样式表: const styles = StyleSheet.create({ profilePicture: { width: 100, }, }); 当我尝试将其应用于化身材质ui组件时(实际上,大多数其他材质ui组件): 但是,如果我将JS对象联机,它可以正常工作: <View> <Avatar src={user.profile_pic_url} style={{width: 100}} />
样式表
:
const styles = StyleSheet.create({
profilePicture: {
width: 100,
},
});
当我尝试将其应用于化身
材质ui组件时(实际上,大多数其他材质ui组件):
但是,如果我将JS对象联机,它可以正常工作:
<View>
<Avatar src={user.profile_pic_url} style={{width: 100}} />
<Text>{user.first_name}</Text>
</View>
{user.first_name}
对于所有其他React本机组件,这很好:给出了什么
The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.
<View>
<Avatar src={user.profile_pic_url} style={{width: 100}} />
<Text>{user.first_name}</Text>
</View>