Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit e1edb83

Browse files
committed
don't bind lifecycle hooks if root component instance is not ES6
1 parent 9501eef commit e1edb83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CodePush.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,12 @@ function codePushify(options = {}) {
430430
let rootComponentInstance = this.refs.rootComponent;
431431

432432
let syncStatusCallback;
433-
if (rootComponentInstance && rootComponentInstance.codePushStatusDidChange) {
433+
if (rootComponentInstance && rootComponentInstance.codePushStatusDidChange && rootComponentInstance instanceof React.Component) {
434434
syncStatusCallback = rootComponentInstance.codePushStatusDidChange.bind(rootComponentInstance);
435435
}
436436

437437
let downloadProgressCallback;
438-
if (rootComponentInstance && rootComponentInstance.codePushDownloadDidProgress) {
438+
if (rootComponentInstance && rootComponentInstance.codePushDownloadDidProgress && rootComponentInstance instanceof React.Component) {
439439
downloadProgressCallback = rootComponentInstance.codePushDownloadDidProgress.bind(rootComponentInstance);
440440
}
441441

0 commit comments

Comments
 (0)