Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/22.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
Reactjs 未显示本机映像组件的映像_Reactjs - Fatal编程技术网

Reactjs 未显示本机映像组件的映像

Reactjs 未显示本机映像组件的映像,reactjs,Reactjs,映像未显示在本机映像组件中 这是我的密码 class Xyz extends Component { render() { return ( <View> <Image style={{width: 50, height: 50}} source={{uri:'{this.props.new}'}} /> </View> ); } } 类

映像未显示在本机映像组件中 这是我的密码

class Xyz extends Component {
  render() {

    return (
    <View>
      <Image
          style={{width: 50, height: 50}}
          source={{uri:'{this.props.new}'}}
        />
        </View>

    );

  }
}
类Xyz扩展组件{ render(){ 返回( ); } }
我想你是这个意思

class Xyz extends Component {
    render() {

        return (
            <View>
                <Image
                    style={{ width: 50, height: 50 }}
                    source={{ uri: this.props.new }}
                />
            </View>

        );
    }
}

您正在将
{this.props.new}
视为字符串。

您应该在
render()方法中尝试以下操作:
source={{{this.props.new}

<View>
  <Image 
      style={{width: 50, height: 50}}
      source={{uri: props.imageUri }} />
</View>


你能展示你的
这个.props.new吗?它是如何传递的,它的价值是什么?有错误吗?我的组件类是类Xyz扩展组件{render(){return();}}}=============================导出默认类lotsofFailures扩展组件{render(){return(可以尝试一下吗?
源代码={{uri:this.props.new}}
ohh非常感谢它很有效非常感谢
<View>
  <Image 
      style={{width: 50, height: 50}}
      source={{uri: props.imageUri }} />
</View>