How to add Share button in React Native ? Last Updated : 25 Jul, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report React Native is an open-source UI software framework created by Meta Platforms, Inc. It is used to develop applications for Android, Android TV, iOS, macOS, tvOS, Web, Windows, and UWP by enabling developers to use the React framework along with native platform capabilities.In this article, we will be learning how we can add a share button in react native.Creating React Native App: Step 1: We'll be using expo to create the react native app. Install expo-cli using the below command in the terminal.npm install -g expo-cliStep 2: Create a react native project using expo.expo init "gfg"Step 3: Now go to the created project using the below command.cd "gfg"Project Structure: It will look like the following:Example: Adding a Share Button: You can easily add a share button in your react native app using the Share API. For this, add the below code inside the App.js file. JavaScript import React from "react"; import { Share, View, Button, Text } from "react-native"; const GfGApp = () => { const shareData = async () => { try { await Share.share({ message: 'This is the demo text', }); } catch (error) { alert(error.message); } }; return ( <View style={{ marginTop: 80 }}> <Text style={{ fontSize: 18 }}> GeeksforGeeks React Native Share</Text> <Button onPress={shareData} title="Share" /> </View> ); }; export default GfGApp; Here we are using the share function of the Share module to add the share button in the app.Run the application: Now run the application using the below command in the terminal.npm run webOutput: Comment More infoAdvertise with us Next Article How to add Color Picker in React Native ? I imranalam21510 Follow Improve Article Tags : React Native Similar Reads How to create a Surface in react-native ? React native is a framework developed by Facebook for creating native-style apps for iOS & Android under one common language, JavaScript. Initially, Facebook only developed React Native to support iOS. However, with its recent support of the Android operating system, the library can now render m 3 min read How to add Color Picker in React Native ? React Native is a popular cross-platform framework for mobile app development using JavaScript. It enables code reuse for iOS and Android platforms and frequently involves incorporating a color picker component. In this article, we'll see how to add a color picker in React native application by usin 2 min read How to create a Banner in react-native ? React Native is a framework developed by Facebook for creating native-style apps for iOS & Android under one common language, JavaScript. Initially, Facebook only developed React Native to support iOS. However, with its recent support of the Android operating system, the library can now render m 3 min read How to Create Social Icons in React Native ? In this article, we will walk through the step-by-step process of creating and styling social icons in your React Native app. React Native emerges as a robust framework for building cross-platform applications effortlessly. By incorporating social icons into your React Native app. Social icons hav 3 min read How to Implement Radio Button In React Native ? In this article, we will learn to implement a Radio Button in React Native. A radio button signifies a graphical user interface element enabling individuals to make an exclusive seÂlection among multiple alternativeÂs. React Native is a popular platform for creating native mobile apps for iOS and A 10 min read How to Copy Text to the Clipboard in React Native ? Mobile app deÂvelopment requires enabling text copying to the clipboard for seÂamless content sharing and improved useÂr experienceÂ. A popular cross-platform framework, React Native, offers a solution to this common requirement. This article will guide developeÂrs through implementing clipboard fun 3 min read Like