reactjs - 如何在打字稿中使用 react-to-print
问题描述
<span className={styles.headerText3}>
<ReactToPrint
trigger={() =><Button
className={styles.buttonColor}
>
<AiOutlinePrinter />
</Button>}
content={() => this.componentRef}
/>
<Table1 ref={el => (this.componentRef = el)} />
我已经按照 react-to-print 中提到的那样尝试了这个,但是它在 this.componentRef 上抛出了错误。我正在使用打字稿,也许这就是问题所在。如何使反应打印在 TS 上工作。
解决方案
推荐阅读
- java - 如何测试 jdbi BinderFactory
- java - 从图像 Java 中删除 chromakey 的简单方法
- events - chrome 扩展内容脚本 (Shadow DOM) 中的 Google Analytics 点击事件跟踪
- json - 来自 OPENJONS() 的 TSQL 具有显式架构:十进制 (38,30) 数据类型中的空字符串
- python - 使用 OpenCV 出错,程序意外关闭
- php - 嵌套的 php 循环消耗了千兆字节的 linux mint 内存
- odoo-11 - odoo 11 在同一窗口中显示多个视图
- azure - 天蓝色逻辑应用架构验证启用/禁用选项
- google-sheets - 如何使用一个条件范围但多个条件来计数?
- java - 如何通过arraylists /多态数组的arraylist进行搜索