File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export default class StatusBarTileController extends React.Component {
26
26
constructor ( props ) {
27
27
super ( props ) ;
28
28
29
- this . refBranchView = new RefHolder ( ) ;
29
+ this . refBranchViewRoot = new RefHolder ( ) ;
30
30
}
31
31
32
32
getChangedFilesCount ( data ) {
@@ -125,14 +125,14 @@ export default class StatusBarTileController extends React.Component {
125
125
/>
126
126
</ Commands >
127
127
< BranchView
128
- ref = { this . refBranchView . setter }
128
+ refRoot = { this . refBranchViewRoot . setter }
129
129
workspace = { this . props . workspace }
130
130
checkout = { this . checkout }
131
131
currentBranch = { repoProps . currentBranch }
132
132
/>
133
133
< Tooltip
134
134
manager = { this . props . tooltips }
135
- target = { this . refBranchView }
135
+ target = { this . refBranchViewRoot }
136
136
trigger = "click"
137
137
className = "github-StatusBarTileController-tooltipMenu" >
138
138
< BranchMenuView
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
2
3
import cx from 'classnames' ;
3
4
4
5
import { BranchPropType } from '../prop-types' ;
5
6
6
7
export default class BranchView extends React . Component {
7
8
static propTypes = {
8
9
currentBranch : BranchPropType . isRequired ,
10
+ refRoot : PropTypes . func ,
11
+ }
12
+
13
+ static defaultProps = {
14
+ refRoot : ( ) => { } ,
9
15
}
10
16
11
17
render ( ) {
@@ -14,7 +20,7 @@ export default class BranchView extends React.Component {
14
20
) ;
15
21
16
22
return (
17
- < div className = { classNames } ref = { e => { this . element = e ; } } >
23
+ < div className = { classNames } ref = { this . props . refRoot } >
18
24
< span className = "icon icon-git-branch" />
19
25
< span className = "branch-label" > { this . props . currentBranch . getName ( ) } </ span >
20
26
</ div >
You can’t perform that action at this time.
0 commit comments