Skip to content

super expression must either be null or a function when I use 'class ImageView extends Image' #21740

@super918180

Description

@super918180

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.5
      CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
      Memory: 698.89 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
      Yarn: 1.3.2 - /usr/local/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        Build Tools: 23.0.1, 23.0.2, 24.0.0, 24.0.1, 24.0.2, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.3, 28.0.1
        API Levels: 19, 22, 23, 24, 25, 26, 27
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0
      react-native: ^0.57.2 => 0.57.2
    npmGlobalPackages:
      react-native-create-library: 3.1.2

Description

super expression must either be null or a function when I use 'class ImageView extends Image'.The same problem with 'extends Text'
image

Reproducible Demo

export default class ImageView extends Image {
 constructor(props) {
   super(props);
 }
 render() {
   ...
   return super.render();
 }
}

Activity

stale

stale commented on Jan 16, 2019

@stale

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

added
StaleThere has been a lack of activity on this issue and it may be closed soon.
on Jan 16, 2019
removed
StaleThere has been a lack of activity on this issue and it may be closed soon.
on Jan 24, 2019
rickhanlonii

rickhanlonii commented on Mar 19, 2019

@rickhanlonii
Member

Hey @super918180 thanks for filing

This doesn't appear to be a RN issue, this is typically something wrong with app code (see stackoverflow for some examples)

If you can provide a full repro example I'm happy to re-open, just note that this practice is generally an anti-pattern in React (see here for more info)

locked as resolved and limited conversation to collaborators on Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @hramos@rickhanlonii@super918180@react-native-bot

        Issue actions

          super expression must either be null or a function when I use 'class ImageView extends Image' · Issue #21740 · facebook/react-native