Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.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 未处理的拒绝(TypeError):\u nbind.externalList[num]。取消引用不是函数(Ract pdf)_Reactjs_Image_React Pdf - Fatal编程技术网

Reactjs 未处理的拒绝(TypeError):\u nbind.externalList[num]。取消引用不是函数(Ract pdf)

Reactjs 未处理的拒绝(TypeError):\u nbind.externalList[num]。取消引用不是函数(Ract pdf),reactjs,image,react-pdf,Reactjs,Image,React Pdf,我想用pdf创建一个报告。 当我使用图像时,会出现此错误。删除图像时没有错误。 如何添加图像。谢谢你的帮助 import React from "react"; import {styles} from "../styles"; import {Text, View,Image} from "@react-pdf/renderer"; export const HeaderBorder = () => ( <View style={{flexDirection: "row"

我想用pdf创建一个报告。 当我使用图像时,会出现此错误。删除图像时没有错误。 如何添加图像。谢谢你的帮助

import React from "react";
import {styles} from "../styles";
import {Text, View,Image} from "@react-pdf/renderer";

export const HeaderBorder = () => (
    <View style={{flexDirection: "row",border: "2 solid black",padding:"5px"}}>
        <View
            style={{
                width: "40%"
            }}
        >
            <Image
                style={{
                    width: "100%",
                    height:"50px",
                    marginHorizontal: 0,
                    marginVertical: 0,

                }}
                src="./logo512"
            />
        </View>
        <View style={{width: "60%"}}>
            <Text>Informations</Text>
        </View>
    </View>
)
从“React”导入React;
从“./styles”导入{styles};
从“@react pdf/renderer”导入{Text,View,Image}”;
导出常量headerOrder=()=>(
信息
)

在PDF渲染过程中触发React重新渲染时,会发生此错误

可能在页面显示后立即开始呈现PDF,但您正在获取一些数据(或执行其他状态操作),这会触发页面的React重新呈现,从而在上一个页面未完成时触发新的PDF呈现


请确保只有在准备好所有数据后才触发PDF渲染,并且不会发生React重新渲染。

谢谢!这正是我的问题,防止PDF重新渲染而不完成第一次渲染解决了它。