first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
"use strict";
import { NavigationContainerRefContext } from '@react-navigation/core';
import * as React from 'react';
import { useBuildAction } from "./useLinkBuilder.js";
/**
* Helper to navigate to a screen using a href based on the linking options.
*
* @returns function that receives the href to navigate to.
*/
export function useLinkTo() {
const navigation = React.useContext(NavigationContainerRefContext);
const buildAction = useBuildAction();
const linkTo = React.useCallback(href => {
if (navigation === undefined) {
throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");
}
const action = buildAction(href);
navigation.dispatch(action);
}, [buildAction, navigation]);
return linkTo;
}
//# sourceMappingURL=useLinkTo.js.map