![](/img/trans.png)
[英]How do I make the useEffect activate when the "Analyze Weather" button is clicked (react.js)
[英]when i clicked disabled button by index that i pass it to function react.js
import React, {
Component
}
from 'react';
class MyApp extends Component {
constructor() {
super();
this.state = {
arr: [1, 2, 3, 4],
disabled: false
};
}
clicked = (index) = > {
this.setState({
disabled: true
})
}
render() {
const maparray = this.state.arr.map((index, MapArray) = > {
return {
MapArray
}
}) return ({
maparray
});
}
}
export
default MyApp;
clicked =(index)=> {document.getElementBYid(index).disavled = true;})} render(){const maparray = this.state.arr.map((index,MapArray)=> {return {MapArray
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.