File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -431,12 +431,18 @@ function codePushify(options = {}) {
431
431
432
432
let syncStatusCallback ;
433
433
if ( rootComponentInstance && rootComponentInstance . codePushStatusDidChange ) {
434
- syncStatusCallback = rootComponentInstance . codePushStatusDidChange . bind ( rootComponentInstance ) ;
434
+ syncStatusCallback = rootComponentInstance . codePushStatusDidChange ;
435
+ if ( rootComponentInstance instanceof React . Component ) {
436
+ syncStatusCallback = syncStatusCallback . bind ( rootComponentInstance ) ;
437
+ }
435
438
}
436
439
437
440
let downloadProgressCallback ;
438
441
if ( rootComponentInstance && rootComponentInstance . codePushDownloadDidProgress ) {
439
- downloadProgressCallback = rootComponentInstance . codePushDownloadDidProgress . bind ( rootComponentInstance ) ;
442
+ downloadProgressCallback = rootComponentInstance . codePushDownloadDidProgress ;
443
+ if ( rootComponentInstance instanceof React . Component ) {
444
+ downloadProgressCallback = downloadProgressCallback . bind ( rootComponentInstance ) ;
445
+ }
440
446
}
441
447
442
448
CodePush . sync ( options , syncStatusCallback , downloadProgressCallback ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ class CodePushDemoApp extends Component {
19
19
}
20
20
21
21
codePushStatusDidChange ( syncStatus ) {
22
- console . log ( this . setState ) ;
23
22
switch ( syncStatus ) {
24
23
case CodePush . SyncStatus . CHECKING_FOR_UPDATE :
25
24
this . setState ( { syncMessage : "Checking for update." } ) ;
You can’t perform that action at this time.
0 commit comments