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

Decorating memoized component #2037

@Kerizer

Description

@Kerizer

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Steps to Reproduce

  1. Wrap functional component into memo function (imported from react or other library)
  2. 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
image

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!)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions