Home > Net >  What is the difference between react-native's Share and react-native-share in npmjs
What is the difference between react-native's Share and react-native-share in npmjs

Time:03-16

I want to implement share the screenshot of the current view in both ios/android. Dont know which one of these API's are better and why they both exist too.

CodePudding user response:

React Native's Share is a method of React Native like static share(content, options) that Open a dialog to share text content. On that the .open() method allows a user to share a premade message via a social medium they choose.

For Further React Native Share Documentation

On the other react-native-share is a package of npm. It is a simple tool for sharing messages and files with other apps.

For further react-native-share

both act as same but one is a method and the other is a package. You can use both to share text or messages with others.

I hope it will beneficial for you to apply. and understanding that differences.

CodePudding user response:

import { Share } from 'react-native'

this will be deprecated in near future

'react-native-share'

this is extracted from react-native

  • Related