reactjs - 在webview react native中使用其组件时无法访问reactjs功能
问题描述
你好,有人可以帮我如何访问我的 ReactJs 组件中的 useEffect 函数吗?我什至无法在其中显示 console.log ?这是我的代码
网页视图组件:
return <WebView
source={{
html: renderToString(
<GraphView
data={this.state.data}
options = {this.state.options}
opts={this.props.opts}
nodes = {this.state.nodes}
edges = {this.state.edges}
/>
),
}}
/>
这是我的 ReactJs 组件
import React,{useEffect} from 'react';
const VisNetwork = (props) => {
useEffect(() => {
console.log("show me please")
});
return (
<div style={{position:"absolute",backgroundColor:"white"}}/>
);
}
解决方案
推荐阅读
- syntax - 如何在不破坏代码的情况下在 Python shell 中使用不同的缩进获取换行符
- node.js - Stripe TLS 1.2 Webhook 问题
- javascript - 预加载页面适用于所有主流浏览器,但 Safari 除外
- spring-boot - 为什么 Spring 的 @Query 注解返回 Object 类型?
- github - Github 桌面提交问题
- javascript - 创建图库时如何解决全局变量问题?
- go - 如何处理go中的多个错误?
- matlab - 如何在 Matlab 中显示具有多个特征的 SVM 图
- html - 如何在桌面视图中显示 unicode
- python - 将图例添加到 plotWidget 时 CSVexporter 失败