<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Raj Kumar</title>
    <description>The latest articles on DEV Community by Raj Kumar (@rkencoresky).</description>
    <link>https://dev.to/rkencoresky</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1006129%2F062c7d1b-8b69-4bf0-b85a-c8258ac403b2.png</url>
      <title>DEV Community: Raj Kumar</title>
      <link>https://dev.to/rkencoresky</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rkencoresky"/>
    <language>en</language>
    <item>
      <title>How to implement mobile share module in ReactJS quickly?</title>
      <dc:creator>Raj Kumar</dc:creator>
      <pubDate>Wed, 11 Jan 2023 14:04:14 +0000</pubDate>
      <link>https://dev.to/rkencoresky/how-to-implement-mobile-share-module-in-reactjs-quickly-3a31</link>
      <guid>https://dev.to/rkencoresky/how-to-implement-mobile-share-module-in-reactjs-quickly-3a31</guid>
      <description>&lt;p&gt;Hello 👋🏼,&lt;/p&gt;

&lt;p&gt;Thanks for reaching here. &lt;br&gt;
Many people require a module which can share data through the default share feature available in our mobile phones(Android, iOS) as shown below :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BkXg21zH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdxe8wb8lvfq7hz19exc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BkXg21zH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdxe8wb8lvfq7hz19exc.png" alt="Image description" width="449" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I know it's very small things you can implement by using any 3rd party packages/modules available on the internet.&lt;/p&gt;

&lt;p&gt;I have one quick solution for you, actually, we have a solution which is based on &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share"&gt;Navigotor.share()&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;You just need to install this package &lt;a href="https://www.npmjs.com/package/react-mobile-share"&gt;react-mobile-share&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i react-mobile-share    # npm
yarn add react-mobile-share # yarn
pnpm i react-mobile-share # pnpm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and use it like this :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;button
  onClick={() =&amp;gt;
      shareOnMobile({
        text: "Hey checkout our package react-mobile-share",
        url: "https://www.npmjs.com/package/react-mobile-share",
        title: "React-Mobile-Share",
      })
    }
  &amp;gt;
  Share
&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all 🙂, it will send data to mobile and prompt a sharing popup with the app suggestion that can handle your data.&lt;/p&gt;

&lt;p&gt;Why should you use this&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don't need to manage extra code.&lt;/li&gt;
&lt;li&gt;Small and lightweight.&lt;/li&gt;
&lt;li&gt;Share text, url and images.&lt;/li&gt;
&lt;li&gt;Works on Android and iOS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also try a demo example with &lt;a href="https://codesandbox.io/s/react-mobile-share-example-r11kjs?file=/src/App.js"&gt;CodeSandbox&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading this 🙏🏻.&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactmobileshare</category>
      <category>reactshare</category>
    </item>
  </channel>
</rss>
