You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-18Lines changed: 32 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,32 @@
1
1
<imgsrc="https://github.com/user-attachments/assets/c965b51b-7307-477a-8d22-9c9cd6da6231"alt="React Native Detour by Software Mansion"width="100%"/>
2
2
3
-
###React Native Detour is SDK for handling deferred links in React Native
3
+
# React Native Detour
4
4
5
-
## Documentation
5
+
SDK for handling deferred links in React Native.
6
6
7
-
Check out our dedicated documentation page for info about this library, API reference and more: [https://docs.swmansion.com/detour/docs/](https://docs.swmansion.com/detour/docs/)
7
+
## Create an account
8
8
9
-
## Create account on platform
9
+
You need a Detour account to generate app credentials and configure your links.
10
+
Sign up here: [https://godetour.dev/auth/signup](https://godetour.dev/auth/signup)
10
11
11
-
Create account and configure your links: [https://godetour.dev/auth/signup](https://godetour.dev/auth/signup)
@@ -75,6 +79,7 @@ export function RootNavigator() {
75
79
}
76
80
77
81
if (linkRoute) {
82
+
clearLink(); // avoid redirecting again when returning to this screen
78
83
return<Redirect href={linkRoute} />;
79
84
}
80
85
@@ -84,11 +89,15 @@ export function RootNavigator() {
84
89
85
90
Learn more about usage from our [docs](https://docs.swmansion.com/detour/docs/SDK/sdk-usage)
86
91
92
+
## Clearing handled links
93
+
94
+
If your app redirects based on `linkRoute` (especially in entry screens), call `clearLink()` after handling the route. This prevents repeated redirects when the user returns to the same screen.
95
+
87
96
## Types
88
97
89
98
The package exposes several types to help you with type-checking in your own codebase.
90
99
91
-
**Config**
100
+
### Config
92
101
93
102
This type is used to define the configuration object you pass to the DetourProvider.
94
103
@@ -119,7 +128,7 @@ export type Config = {
119
128
};
120
129
```
121
130
122
-
**DetourContextType**
131
+
### DetourContextType
123
132
124
133
This type represents the object returned by the useDetourContext hook, containing the deferred link and its processing status.
125
134
@@ -145,12 +154,17 @@ export type DetourContextType = {
145
154
* The type of the detected link. Can be 'deferred', 'verified' or 'scheme'. This can be null if no link was found.
146
155
*/
147
156
linkType: LinkType | null;
157
+
158
+
/**
159
+
* Clears the current link context (route/url/type). Call this after you handle a link.
160
+
*/
161
+
clearLink: () => void;
148
162
};
149
163
```
150
164
151
165
---
152
166
153
-
## :balance_scale:License
167
+
## License
154
168
155
169
This library is licensed under [The MIT License](./LICENSE).
0 commit comments