@granite-js/react-native 0.1.23-next.0 → 0.1.23-next.4
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.
- package/CHANGELOG.md +30 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/useWaitForReturnNavigator.d.ts +39 -0
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @granite-js/react-native
|
|
2
2
|
|
|
3
|
+
## 0.1.23-next.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- test
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @granite-js/plugin-core@0.1.23-next.4
|
|
10
|
+
- @granite-js/style-utils@0.1.23-next.4
|
|
11
|
+
- @granite-js/lottie@0.1.23-next.4
|
|
12
|
+
- @granite-js/native@0.1.23-next.4
|
|
13
|
+
- @granite-js/image@0.1.23-next.4
|
|
14
|
+
- @granite-js/mpack@0.1.23-next.4
|
|
15
|
+
- @granite-js/jest@0.1.23-next.4
|
|
16
|
+
- @granite-js/cli@0.1.23-next.4
|
|
17
|
+
|
|
18
|
+
## 0.1.23-next.3
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- test
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- @granite-js/plugin-core@0.1.23-next.3
|
|
25
|
+
- @granite-js/style-utils@0.1.23-next.3
|
|
26
|
+
- @granite-js/lottie@0.1.23-next.3
|
|
27
|
+
- @granite-js/native@0.1.23-next.3
|
|
28
|
+
- @granite-js/image@0.1.23-next.3
|
|
29
|
+
- @granite-js/mpack@0.1.23-next.3
|
|
30
|
+
- @granite-js/jest@0.1.23-next.3
|
|
31
|
+
- @granite-js/cli@0.1.23-next.3
|
|
32
|
+
|
|
3
33
|
## 0.1.23-next.0
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -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.
|
|
3
|
+
"version": "0.1.23-next.4",
|
|
4
4
|
"description": "The Granite Framework",
|
|
5
5
|
"bin": {
|
|
6
6
|
"granite": "./bin/cli.js"
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@babel/core": "^7.24.9",
|
|
87
87
|
"@babel/preset-env": "^7.24.8",
|
|
88
88
|
"@babel/preset-typescript": "^7.24.7",
|
|
89
|
-
"@granite-js/native": "0.1.23-next.
|
|
89
|
+
"@granite-js/native": "0.1.23-next.4",
|
|
90
90
|
"@testing-library/dom": "^10.4.0",
|
|
91
91
|
"@testing-library/react": "^16.1.0",
|
|
92
92
|
"@types/babel__core": "^7",
|
|
@@ -98,25 +98,25 @@
|
|
|
98
98
|
"eslint": "^9.7.0",
|
|
99
99
|
"jsdom": "^25.0.1",
|
|
100
100
|
"react": "npm:19.1.0",
|
|
101
|
-
"react-native": "npm:0.81.
|
|
101
|
+
"react-native": "npm:0.81.3",
|
|
102
102
|
"tsup": "^8.5.0",
|
|
103
103
|
"typescript": "5.8.3",
|
|
104
104
|
"vitest": "^2.1.8"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
|
-
"@granite-js/native": "0.1.23-next.
|
|
107
|
+
"@granite-js/native": "0.1.23-next.4",
|
|
108
108
|
"@types/react": "*",
|
|
109
109
|
"react": "*",
|
|
110
110
|
"react-native": "*"
|
|
111
111
|
},
|
|
112
112
|
"dependencies": {
|
|
113
|
-
"@granite-js/cli": "0.1.23-next.
|
|
114
|
-
"@granite-js/image": "0.1.23-next.
|
|
115
|
-
"@granite-js/jest": "0.1.23-next.
|
|
116
|
-
"@granite-js/lottie": "0.1.23-next.
|
|
117
|
-
"@granite-js/mpack": "0.1.23-next.
|
|
118
|
-
"@granite-js/plugin-core": "0.1.23-next.
|
|
119
|
-
"@granite-js/style-utils": "0.1.23-next.
|
|
113
|
+
"@granite-js/cli": "0.1.23-next.4",
|
|
114
|
+
"@granite-js/image": "0.1.23-next.4",
|
|
115
|
+
"@granite-js/jest": "0.1.23-next.4",
|
|
116
|
+
"@granite-js/lottie": "0.1.23-next.4",
|
|
117
|
+
"@granite-js/mpack": "0.1.23-next.4",
|
|
118
|
+
"@granite-js/plugin-core": "0.1.23-next.4",
|
|
119
|
+
"@granite-js/style-utils": "0.1.23-next.4",
|
|
120
120
|
"es-toolkit": "^1.39.8",
|
|
121
121
|
"react-native-url-polyfill": "1.3.0"
|
|
122
122
|
}
|