File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ export interface IProps {
13
13
className ?: string ;
14
14
}
15
15
export class UISref extends Component < IProps , any > {
16
+ // deregister function for parent UISrefActive
17
+ deregister : Function ;
16
18
static propTypes = {
17
19
children : PropTypes . element . isRequired ,
18
20
to : PropTypes . string . isRequired ,
@@ -28,7 +30,13 @@ export class UISref extends Component<IProps,any> {
28
30
29
31
componentWillMount ( ) {
30
32
const addStateInfo = this . context [ 'parentUiSrefActiveAddStateInfo' ] ;
31
- typeof addStateInfo === 'function' && addStateInfo ( this . props . to , this . props . params ) ;
33
+ this . deregister = typeof addStateInfo === 'function'
34
+ ? addStateInfo ( this . props . to , this . props . params )
35
+ : ( ) => { } ;
36
+ }
37
+
38
+ componentWillUnmount ( ) {
39
+ this . deregister ( ) ;
32
40
}
33
41
34
42
getOptions = ( ) => {
You can’t perform that action at this time.
0 commit comments