Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 为什么可以';我是否使用样式表道具作为材质ui组件的样式道具?_React Native_Material Ui - Fatal编程技术网

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>