Browse Source

Use bound function

Guy Carmeli 6 years ago
parent
commit
5a43de8cec
1 changed files with 1 additions and 2 deletions
  1. 1
    2
      playground/src/screens/TextScreen.js

+ 1
- 2
playground/src/screens/TextScreen.js View File

@@ -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