React Native 性能优化总结

设置 props 方法并经过事件绑定在元素上   onPress() { } <TestComponent onPress={this.onPress.bind(this)} /> 这样写,每一次渲染都会从新绑定 onPress方法, 不要让方法每一次都绑定,所以把绑定移动到构造器内。this constructor(props) { super(props); this
相关文章
相关标签/搜索