Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CodePush.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,15 @@ function codePushify(options = {}) {
}

render() {
return <RootComponent {...this.props} ref={"rootComponent"} />
const props = {...this.props};

// we can set ref property on class components only (not stateless)
// check it by render method
if (RootComponent.prototype.render) {
props.ref = "rootComponent";
}

return <RootComponent {...props} />
}
}
}
Expand Down