浏览代码

Use bound function

Guy Carmeli 6 年前
父节点
当前提交
5a43de8cec
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1
    2
      playground/src/screens/TextScreen.js

+ 1
- 2
playground/src/screens/TextScreen.js 查看文件

@@ -23,7 +23,6 @@ class TextScreen extends Component {
23 23
   constructor(props) {
24 24
     super(props);
25 25
     globalFirstComponentID = (props.text === 'This is tab 1') ? props.componentId : globalFirstComponentID;
26
-    this.onClickPop = this.onClickPop.bind(this);
27 26
   }
28 27
 
29 28
   render() {
@@ -44,7 +43,7 @@ class TextScreen extends Component {
44 43
     );
45 44
   }
46 45
 
47
-  async onClickPop() {
46
+  onClickPop = async () => {
48 47
     await Navigation.pop(this.props.componentId);
49 48
   }
50 49