React Native 性能優化總結

設置 props 方法並經過事件綁定在元素上   onPress() { } <TestComponent onPress={this.onPress.bind(this)} /> 這樣寫,每一次渲染都會從新綁定 onPress方法, 不要讓方法每一次都綁定,所以把綁定移動到構造器內。this constructor(props) { super(props); this
相關文章
相關標籤/搜索