Giter Club home page Giter Club logo

Comments (4)

markgoodyear avatar markgoodyear commented on May 26, 2024 22

@andyfenelon, @IsTheJack, Actually, this is solved by just adding in a catch. If a user doesn't share, it throws an error of Object {error: "User did not share"} โ€”ย which will be unhandled without a catch.

So to prevent the warning you can do:

Share.open({
  // share config here
})
.catch(err => console.log(err));

from react-native-share.

ncuillery avatar ncuillery commented on May 26, 2024 11

I don't really like this workaround. IMO the module shouldn't reject the promise in this case because it's not an "error scenario". Can anybody reopen the issue ?

At least, the rejected value must allow distinction between this case and real errors (creating a UserCancelError should do the job).

According to the JS coding conventions, a promise should reject a instance of Error (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/reject#Description), not an object containing a key named error

I'd remove the use of Exception that is not standard in JavaScript: https://github.com/EstebanFuentealba/react-native-share/blob/master/index.js#L71 (or maybe it's a Windows thing ?)

Are you guys open to a PR ?

from react-native-share.

IsTheJack avatar IsTheJack commented on May 26, 2024

I was getting this error too:
simulator screen shot aug 1 2016 2 35 32 pm

from react-native-share.

markgoodyear avatar markgoodyear commented on May 26, 2024

I'm getting this also.

from react-native-share.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.