@rnhooks/linking
v0.0.1
Published
React Native Hook for Linking
Downloads
26
Readme
@rnhooks/linking
React Native hook for Linking
Installation
yarn add @rnhooks/linking
Usage
import useLinking from '@rnhooks/linking';
function App() {
const [url, openUrl, error] = useLinking();
return (
<View style={styles.container}>
<Text style={styles.welcome}>@rnhooks/linking</Text>
<Text style={styles.instructions}>Linking URL</Text>
<Text style={styles.instructions}>{url || error}</Text>
<Button title="Update" onPress={() => openUrl(URL)} />
</View>
);
}
Output
| Name | Default | Type | Description |
| ------- | ----------- | --------:| ---------------- |
| url | null
| string | Linking URL |
| openUrl | () => {}
| function | Open Linking URL |
| error | null
| string | Error |