Skip to content

[0.50.4] Share API Error: ActionSheetManager is undefined #17035

@joncursi

Description

@joncursi

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
  OS: macOS High Sierra 10.13.1
  Node: 8.9.1
  Yarn: 1.3.2
  npm: 5.5.1
  Watchman: 4.9.0
  Xcode: Xcode 9.1 Build version 9B55
  Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
  react: 16.0.0 => 16.0.0
  react-native: 0.50.4 => 0.50.4

Steps to Reproduce

  1. In the onPress handler of a touchable component, call Share.share(...).then(...).catch((error) => console.log(error));
  2. Check JS console logs

Expected Behavior

The Share API should not error.

Actual Behavior

The Share API errors:

TypeError: Cannot read property 'showShareActionSheetWithOptions' of undefined
    at Share.js:83
    at tryCallTwo (core.js:45)
    at doResolve (core.js:200)
    at new Promise (core.js:66)
    at Function.share (Share.js:82)
    at ActivityGlobal._shareMessage (activityGlobal.js:76)
    at ActivityGlobal.proxiedMethod (createPrototypeProxy.js:44)
    at Object.touchableHandlePress (TouchableHighlight.js:285)
    at Object._performSideEffectsForTransition (Touchable.js:746)
    at Object._receiveSignal (Touchable.js:664)

The error is on this line:

ActionSheetManager.showShareActionSheetWithOptions(

ActionSheetManager is undefined here.

Reproducible Demo

See steps above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions