@granite-js/react-native 0.1.23-next.0 → 0.1.23-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export { useWaitForReturnNavigator } from './useWaitForReturnNavigator';
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @public
3
+ * @category Screen Control
4
+ * @name useWaitForReturnNavigator
5
+ * @description
6
+ * A Hook that helps execute the next code synchronously when returning from a screen transition.
7
+ * Screen navigation uses [@react-navigation/native `useNavigation`'s `navigate`](https://reactnavigation.org/docs/6.x/navigation-prop#navigate).
8
+ *
9
+ * For example, it can be used when you want to log that a user has navigated to another screen and returned.
10
+ *
11
+ * @example
12
+ * ### Example of code execution when returning from screen navigation
13
+ *
14
+ * When the **"Navigate"** button is pressed, it navigates to another screen, and logs are created when returning.
15
+ *
16
+ * ```tsx
17
+ * import { Button } from 'react-native';
18
+ * import { useWaitForReturnNavigator } from '@granite-js/react-native';
19
+ *
20
+ * export function UseWaitForReturnNavigator() {
21
+ * const navigate = useWaitForReturnNavigator();
22
+ *
23
+ * return (
24
+ * <>
25
+ * <Button
26
+ * title="Navigate"
27
+ * onPress={async () => {
28
+ * console.log(1);
29
+ * await navigate('/examples/use-visibility');
30
+ * // This code executes when returning to the screen
31
+ * console.log(2);
32
+ * }}
33
+ * />
34
+ * </>
35
+ * );
36
+ * }
37
+ * ```
38
+ */
39
+ export declare function useWaitForReturnNavigator<T extends Record<string, object | undefined>>(): <RouteName extends keyof T>(route: RouteName, params?: T[RouteName]) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@granite-js/react-native",
3
- "version": "0.1.23-next.0",
3
+ "version": "0.1.23-next.1",
4
4
  "description": "The Granite Framework",
5
5
  "bin": {
6
6
  "granite": "./bin/cli.js"
@@ -110,11 +110,11 @@
110
110
  "react-native": "*"
111
111
  },
112
112
  "dependencies": {
113
- "@granite-js/cli": "0.1.23-next.0",
113
+ "@granite-js/cli": "0.1.23-next.1",
114
114
  "@granite-js/image": "0.1.23-next.0",
115
115
  "@granite-js/jest": "0.1.23-next.0",
116
116
  "@granite-js/lottie": "0.1.23-next.0",
117
- "@granite-js/mpack": "0.1.23-next.0",
117
+ "@granite-js/mpack": "0.1.23-next.1",
118
118
  "@granite-js/plugin-core": "0.1.23-next.0",
119
119
  "@granite-js/style-utils": "0.1.23-next.0",
120
120
  "es-toolkit": "^1.39.8",