How to take screenshot and share it in react native

Generate a splash screen image

React native Splash screen Android Folder setup

Yarn add react-native-splash-screen

package com.mysplashscreen;

import android.os.Bundle; // here

import com.facebook.react.ReactActivity;

import org.devio.rn.splashscreen.SplashScreen; // here

public class MainActivity extends ReactActivity {

  @Override

  protected String getMainComponentName() {

    return “MySplashScreen”;

  }

  @Override

    protected void onCreate(Bundle savedInstanceState) {

        SplashScreen.show(this);  // here

        super.onCreate(savedInstanceState);

    }

}

        <?xml version=“1.0” encoding=“utf-8”?>

<RelativeLayout xmlns:android=“http://schemas.android.com/apk/res/android”

    android:orientation=“vertical” android:layout_width=“match_parent”

    android:layout_height=“match_parent”>

    <ImageView android:layout_width=“match_parent” android:layout_height=“match_parent” android:src=“@drawable/screen” android:scaleType=“centerCrop” />

</RelativeLayout>

        <?xml version=“1.0” encoding=“utf-8”?>

<resources>

    <color name=“primary_dark”>#000000</color>

</resources>

import SplashScreen from  “react-native-splash-screen”;

 const App  = () => {

 

  //Hide Splash screen on app load.

   React.useEffect(() => {

     SplashScreen.hide();

   });   return (…)}

Sources for reference