@@ -29,19 +29,25 @@ export default class App extends React.Component {
2929 searchFoundCount : null ,
3030 treeData,
3131 } ;
32+
33+ this . handleTreeOnChange = this . handleTreeOnChange . bind ( this ) ;
34+ this . handleSearchOnChange = this . handleSearchOnChange . bind ( this ) ;
35+ this . selectPrevMatch = this . selectPrevMatch . bind ( this ) ;
36+ this . selectNextMatch = this . selectNextMatch . bind ( this ) ;
37+ this . toggleNodeExpansion = this . toggleNodeExpansion . bind ( this ) ;
3238 }
3339
34- handleTreeOnChange = treeData => {
40+ handleTreeOnChange ( treeData ) {
3541 this . setState ( { treeData } ) ;
36- } ;
42+ }
3743
38- handleSearchOnChange = e => {
44+ handleSearchOnChange ( e ) {
3945 this . setState ( {
4046 searchString : e . target . value ,
4147 } ) ;
42- } ;
48+ }
4349
44- selectPrevMatch = ( ) => {
50+ selectPrevMatch ( ) {
4551 const { searchFocusIndex, searchFoundCount } = this . state ;
4652
4753 this . setState ( {
@@ -50,9 +56,9 @@ export default class App extends React.Component {
5056 ? ( searchFoundCount + searchFocusIndex - 1 ) % searchFoundCount
5157 : searchFoundCount - 1 ,
5258 } ) ;
53- } ;
59+ }
5460
55- selectNextMatch = ( ) => {
61+ selectNextMatch ( ) {
5662 const { searchFocusIndex, searchFoundCount } = this . state ;
5763
5864 this . setState ( {
@@ -61,16 +67,16 @@ export default class App extends React.Component {
6167 ? ( searchFocusIndex + 1 ) % searchFoundCount
6268 : 0 ,
6369 } ) ;
64- } ;
70+ }
6571
66- toggleNodeExpansion = expanded => {
72+ toggleNodeExpansion ( expanded ) {
6773 this . setState ( prevState => ( {
6874 treeData : toggleExpandedForAll ( {
6975 treeData : prevState . treeData ,
7076 expanded,
7177 } ) ,
7278 } ) ) ;
73- } ;
79+ }
7480
7581 render ( ) {
7682 const {
0 commit comments