import React, { useState, useEffect } from "react";import { Linking, StyleSheet, Text, View } from "react-native";const useMount = func => useEffect(() => func(), []);const useInitialURL = () => { const [url, setUrl] = useState(null); const [processing, setProcessing] = useState(true); useMount(() => { const getUrlAsync = async () => { // Get the deep link used to open the app const initialUrl = await Linking.getInitialURL(); // The setTimeout is just for testing purpose setTimeout(() => { setUrl(initialUrl); setProcessing(false); }, 1000); }; getUrlAsync(); }); return { url, processing };};const App = () => { const { url: initialUrl, processing } = useInitialURL(); return ( {processing ? `Processing the initial url from a deep link` : `The deep link is: ${initialUrl || "None"}`} );};const styles = StyleSheet.create({ container: { flex: 1, justifyContent: "center", alignItems: "center" },});export default App;