This repository was archived by the owner on May 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Decorating memoized component #2037
Copy link
Copy link
Closed
Description
Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):
Steps to Reproduce
- Wrap functional component into
memo
function (imported fromreact
or other library) - Decorate this component with codepush
Expected Behavior
Codepush is working
Actual Behavior
When checking if render
method exists there is no check if RootComponent.prototype
exists - and it does not exists if RootComponent
is wrapped into memo
- https://github.com/microsoft/react-native-code-push/blob/master/CodePush.js#L581
Simplest solution would be to change if (RootComponent.prototype.render) {
with if (RootComponent.prototype && RootComponent.prototype.render) {
(let's say somebody really needs to use memo
on the codepushuble component for whatever reason)
Environment
- react-native-code-push version: 7.0.0
- react-native version: Any
- iOS/Android/Windows version: Any
- Does this reproduce on a debug build or release build? - Both
- Does this reproduce on a simulator, or only on a physical device? -Both
(The more info the faster we will be able to address it!)