React 学习笔记 —— 事件绑定和 state 属性修改简写版
发布日期:2021-05-12 21:18:27 浏览次数:12 分类:精选文章

本文共 429 字,大约阅读时间需要 1 分钟。

crear un componente probsceptual React

class Weather extends React.Component {constructor(props) {super(props);}

state = {isHot: false,wind: '������'};

render() {const { isHot, wind } = this.state;

return (  

��������������� {this.state.isHot ? '������' : '������'}, {wind}

);

}

weatherClick = () => {const isHot = this.state.isHot;this.setState({isHot: !isHot});};}

ReactDOM.render(

, document.getElementById('test'));

上一篇:React 学习笔记 —— props 属性
下一篇:React学习笔记——类中的方法内部的this指向

发表评论

最新留言

哈哈,博客排版真的漂亮呢~
[***.90.31.176]2025年04月28日 12时05分28秒