Page MenuHomePhabricator

D5397.diff
No OneTemporary

D5397.diff

diff --git a/native/flow-typed/npm/@react-navigation/native_v5.x.x.js b/native/flow-typed/npm/@react-navigation/native_v5.x.x.js
--- a/native/flow-typed/npm/@react-navigation/native_v5.x.x.js
+++ b/native/flow-typed/npm/@react-navigation/native_v5.x.x.js
@@ -2228,21 +2228,32 @@
* Linking
*/
+ declare export type LinkTo<
+ ParamList: ParamListBase,
+ RouteName: $Keys<ParamList>,
+ > =
+ | string
+ | {| +screen: RouteName, +params?: $ElementType<ParamList, RouteName> |};
+
declare export var Link: React$ComponentType<{
- +to: string,
+ +to: LinkTo<>,
+action?: GenericNavigationAction,
+target?: string,
+children: React$Node,
...
}>;
- declare export function useLinkTo(): (path: string) => void;
+ declare export function useLinkTo<ParamList: ParamListBase>(
+ ): (path: LinkTo<ParamList,>) => void;
- declare export function useLinkProps<To: string>(props: {|
- +to: To,
+ declare export function useLinkProps<
+ ParamList: ParamListBase,
+ RouteName: $Keys<ParamList>,
+ >(props: {|
+ +to: LinkTo<ParamList, RouteName>,
+action?: GenericNavigationAction,
|}): {|
- +href: To,
+ +href: string,
+accessibilityRole: 'link',
+onPress: (MouseEvent | PressEvent) => void,
|};

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 10, 5:43 AM (15 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2845704
Default Alt Text
D5397.diff (1 KB)

Event Timeline