我得到了这个错误: ERROR RangeError: Maximum call stack size exceeded
at ChartElement.update (Chart.js:11474)
at fitBoxes (Chart.js:7127)
at fitBoxes (Chart.js:7145)
at fitBoxes (Chart.js:7145)
at fitBoxes (Chart.js:7145)
at fitBoxes (Chart.js:7145)
at fitBoxes (Chart.js:7145)
我有(例如)反应中有两种成分。第一个App.js是父组件。它将一些值传递给子组件Child.js。在child.js,中,它通过props接收值,并使用axios调用结果更新一些state变量。这个很好用。
现在,我需要在App.js中获得更新结果值。如何在App.js中获得该值
App.js
this.state ({ ...
examResult: null // need to update this with the child component result.
})
<ChildComponent
Id={this.state.StudentId}
我有两个.js文件: root.js和external.js
root.js
import myExternalFunction from 'external.js'
class Parent {
constructor(){}
parentFunction = () => {
console.log('I was called from an external function using "this."')
}
}
external.js
export default myExternalFun
我正在为我的应用程序中的用户创建一个配置文件屏幕。我正在使用来自React-Native-Navigation by wix的lightbox来执行编辑配置文件。因此,用户将单击touchableopacity并弹出一个灯箱,用户将输入新信息并保存它。因此,我想知道是否可以将lightbox中的文本输入值传递给父profile.js (profile.js),以便在lightbox中设置状态?
我有两个类,看起来像这样:
class db {
protected $db;
function __construct() {
$this->connect();
}
protected function connect() {
$this->db = new MySQLi(db_host, db_user, db_pass, db_name) or die($this->db->error);
$this->db->set_charset('utf8')
我有一个需求,在这里我制作了一个可重用的模式,其结构如下所示:
--Parent.js
--ModalComponent.js
在parent中,我只需单击一下即可创建模式内容,
getModalContent = () => {
let ModalBody = (
<div onClick={this.clickableHandler}> //I want this clickableHandler to trigger in child(modal component)
This is clickable
</div>