xbrave

xbrave

🏢  FrontEnd Engineer
V2EX 第 375115 号会员,加入于 2019-01-04 11:33:55 +08:00
根据 xbrave 的设置,主题列表只有在你登录之后才可查看
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
xbrave 最近回复了
2020-08-04 11:18:22 +08:00
回复了 6234127 创建的主题 Apple 安卓手机能使用 Airpods Pro 么, 效果咋样呢
Airpods Pro 你就当是一个普通的蓝牙耳机,哪个系统的手机都能用
建议阅读 React 文档官网上的 handling Events 这一节:https://reactjs.org/docs/handling-events.html
You have to be careful about the meaning of this in JSX callbacks. In JavaScript, class methods are not bound by default. If you forget to bind this.handleClick and pass it to onClick, this will be undefined when the function is actually called.

This is not React-specific behavior; it is a part of how functions work in JavaScript. Generally, if you refer to a method without () after it, such as onClick={this.handleClick}, you should bind that method.

If calling bind annoys you, there are two ways you can get around this. If you are using the experimental public class fields syntax, you can use class fields to correctly bind callbacks
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1536 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 58ms · UTC 17:00 · PVG 01:00 · LAX 09:00 · JFK 12:00
Developed with CodeLauncher
♥ Do have faith in what you're doing.