You do not need npm install link --save or use the Link Libraries in iOS ". The components" <Linking /> "and" Link the action of librairies "are two different things.
<Linking /> is a component that allows you to open links (web links or links to other applications) and determine when your application is called from a link (from a browser or other application, or a push notification, for example). It is a core component of React Native, and comes with a reaction-based npm package.
Linking librairies is necessary when installing a third-party library (for example, react-native-maps ) and you need to add dependencies to the iOS Xcode and Android Gradle build configurations. This is usually done using the react-native link <package> command after npm install .
The only thing you have to do is require or import <Linking /> into your javascript file before using it. You do not even need complete information about Processing deep links from the documentation. This is only for inbound links that open your application. All you need starts with Opening External Links
Now, why your code crashes is a mystery. Here is a link to a working application with the same behavior. A brief example:
import React from 'react'; import { TouchableOpacity, Linking, Text } from 'react-native'; export default function Button() { return ( <TouchableOpacity onPress={() => Linking.openURL('https://maps.google.com?q=stack+overflow+offices')}> <Text>Press me</Text> </TouchableOpacity> ); }
You can also test it here on rnplay .
I suggest cleaning up the project by deleting the node_modules folder and making npm install again and compiling your project with a new one.
Damien varron
source share