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
You can check the list of the supported methods and the arguments overload [here](./src/helpers/createNavigationHelpers.ts).
104
+
You can check the list of the supported methods and the arguments overload [here](./src/helpers/createNavigationCommands.ts).
104
105
105
106
### `useNavigationComponentDidAppear`
106
107
@@ -111,21 +112,21 @@ import { useNavigationComponentDidAppear } from 'react-native-navigation-hooks'
111
112
112
113
const ScreenComponent = ({ componentId }) => {
113
114
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider> (if neither of those are provided it will warn you at least you provide a `{ global: true}` option)
114
-
useNavigationComponentDidAppear(e=> {
115
+
useNavigationComponentDidAppear((e)=> {
115
116
console.log(`${e.componentName} appeared`)
116
117
})
117
118
118
119
// Listen events only for this screen by providing componentId as paramenter
119
120
useNavigationComponentDidAppear(
120
-
e=> {
121
+
(e)=> {
121
122
console.log(`${e.componentName} appeared`)
122
123
},
123
124
{ componentId }
124
125
)
125
126
126
127
// Global event handler. You should probably never use this but just in case.
127
128
useNavigationComponentDidAppear(
128
-
e=> {
129
+
(e)=> {
129
130
console.log(`${e.componentName} appeared`)
130
131
},
131
132
{ global: true }
@@ -144,21 +145,21 @@ import { useNavigationComponentDidDisappear } from 'react-native-navigation-hook
144
145
145
146
const ScreenComponent = ({ componentId }) => {
146
147
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider> (if neither of those are provided it will warn you at least you provide a `{ global: true}` option)
147
-
useNavigationComponentDidDisappear(e=> {
148
+
useNavigationComponentDidDisappear((e)=> {
148
149
console.log(`${e.componentName} appeared`)
149
150
})
150
151
151
152
// Listen events only for this screen by providing componentId as paramenter
152
153
useNavigationComponentDidDisappear(
153
-
e=> {
154
+
(e)=> {
154
155
console.log(`${e.componentName} appeared`)
155
156
},
156
157
{ componentId }
157
158
)
158
159
159
160
// Global event handler. You should probably never use this but just in case.
160
161
useNavigationComponentDidDisappear(
161
-
e=> {
162
+
(e)=> {
162
163
console.log(`${e.componentName} appeared`)
163
164
},
164
165
{ global: true }
@@ -221,21 +222,21 @@ import { useNavigationModalAttemptedToDismiss } from 'react-native-navigation-ho
221
222
222
223
const ScreenComponent = ({ componentId }) => {
223
224
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider> (if neither of those are provided it will warn you at least you provide a `{ global: true}` option)
224
-
useNavigationModalAttemptedToDismiss(e=> {
225
+
useNavigationModalAttemptedToDismiss((e)=> {
225
226
console.log(`Modal attempted dismissed on componentId: ${e.componentId}`)
226
227
})
227
228
228
229
// Listen events only for this screen by providing componentId as paramenter
229
230
useNavigationModalAttemptedToDismiss(
230
-
e=> {
231
+
(e)=> {
231
232
console.log(`Modal attempted dismissed on componentId: ${e.componentId}`)
232
233
},
233
234
{ componentId }
234
235
)
235
236
236
237
// Global event handler. You should probably never use this but just in case.
237
238
useNavigationModalAttemptedToDismiss(
238
-
e=> {
239
+
(e)=> {
239
240
console.log(`Modal attempted dismissed on componentId: ${e.componentId}`)
240
241
},
241
242
{ global: true }
@@ -254,21 +255,21 @@ import { useNavigationModalDismiss } from 'react-native-navigation-hooks'
254
255
255
256
const ScreenComponent = ({ componentId }) => {
256
257
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider> (if neither of those are provided it will warn you at least you provide a `{ global: true}` option)
257
-
useNavigationModalDismiss(e=> {
258
+
useNavigationModalDismiss((e)=> {
258
259
console.log(`Modals dismissed: ${e.modalsDismissed} on componentId: ${e.componentId}`)
259
260
})
260
261
261
262
// Listen events only for this screen by providing componentId as paramenter
262
263
useNavigationModalDismiss(
263
-
e=> {
264
+
(e)=> {
264
265
console.log(`Modals dismissed: ${e.modalsDismissed} on componentId: ${e.componentId}`)
265
266
},
266
267
{ componentId }
267
268
)
268
269
269
270
// Global event handler. You should probably never use this but just in case.
270
271
useNavigationModalDismiss(
271
-
e=> {
272
+
(e)=> {
272
273
console.log(`Modals dismissed: ${e.modalsDismissed} on componentId: ${e.componentId}`)
273
274
},
274
275
{ global: true }
@@ -287,21 +288,21 @@ import { useNavigationScreenPop } from 'react-native-navigation-hooks'
287
288
288
289
const ScreenComponent = ({ componentId }) => {
289
290
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider> (if neither of those are provided it will warn you at least you provide a `{ global: true}` option)
290
-
useNavigationScreenPop(e=> {
291
+
useNavigationScreenPop((e)=> {
291
292
console.log(`Screen was popped on componentId: ${e.componentId}`)
292
293
})
293
294
294
295
// Listen events only for this screen by providing componentId as paramenter
295
296
useNavigationScreenPop(
296
-
e=> {
297
+
(e)=> {
297
298
console.log(`Screen was popped on componentId: ${e.componentId}`)
298
299
},
299
300
{ componentId }
300
301
)
301
302
302
303
// Global event handler. You should probably never use this but just in case.
303
304
useNavigationScreenPop(
304
-
e=> {
305
+
(e)=> {
305
306
console.log(`Screen was popped on componentId: ${e.componentId}`)
306
307
},
307
308
{ global: true }
@@ -320,7 +321,7 @@ import { useNavigationBottomTabSelect } from 'react-native-navigation-hooks'
320
321
321
322
const ScreenComponent = ({ componentId }) => {
322
323
// Global listener
323
-
useNavigationBottomTabSelect(e=> {
324
+
useNavigationBottomTabSelect((e)=> {
324
325
console.log(`Selected tab id ${e.selectedTabIndex}, unselected tab id ${e.unselectedTabIndex}`)
325
326
})
326
327
@@ -337,7 +338,7 @@ import { useNavigationBottomTabPress } from 'react-native-navigation-hooks'
337
338
338
339
const ScreenComponent = ({ componentId }) => {
339
340
// Global listener
340
-
useNavigationBottomTabPress(e=> {
341
+
useNavigationBottomTabPress((e)=> {
341
342
console.log(`Selected tab id ${e.tabIndex}`)
342
343
})
343
344
@@ -354,7 +355,7 @@ import { useNavigationBottomTabLongPress } from 'react-native-navigation-hooks'
354
355
355
356
const ScreenComponent = ({ componentId }) => {
356
357
// Global listener
357
-
useNavigationBottomTabLongPress(e=> {
358
+
useNavigationBottomTabLongPress((e)=> {
358
359
console.log(`Selected tab id ${e.selectedTabIndex}`)
359
360
})
360
361
@@ -371,29 +372,29 @@ import { useNavigationButtonPress } from 'react-native-navigation-hooks'
371
372
372
373
const ScreenComponent = ({ componentId }) => {
373
374
// Listen events only for this screen and all buttons when using withNavigation HOC or <NavigationProvider> (if neither of those are provided it will warn you at least you provide a `{ global: true}` option)
374
-
useNavigationButtonPress(e=> {
375
+
useNavigationButtonPress((e)=> {
375
376
console.log(`Pressed ${e.buttonId} on componentId: ${e.componentId}`)
376
377
})
377
378
378
379
// Listen events only for this screen and all buttons by providing componentId as paramenter
379
380
useNavigationButtonPress(
380
-
e=> {
381
+
(e)=> {
381
382
console.log(`Pressed ${e.buttonId} on componentId: ${e.componentId}`)
382
383
},
383
384
{ componentId }
384
385
)
385
386
386
387
// Global event handler. You should probably never use this but just in case.
387
388
useNavigationButtonPress(
388
-
e=> {
389
+
(e)=> {
389
390
console.log(`Pressed ${e.buttonId} on componentId: ${e.componentId}`)
390
391
},
391
392
{ global: true }
392
393
)
393
394
394
395
// Listen events only for this screen and a specifi buttonc by providing componentId and button as options
395
396
useNavigationButtonPress(
396
-
e=> {
397
+
(e)=> {
397
398
console.log('Pressed profile button on this screen!')
398
399
},
399
400
{ componentId, buttonId: 'profileButton' }
@@ -412,21 +413,21 @@ import { useNavigationSearchBarUpdate } from 'react-native-navigation-hooks'
412
413
413
414
const ScreenComponent = ({ componentId }) => {
414
415
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider> (if neither of those are provided it will warn you at least you provide a `{ global: true}` option)
415
-
useNavigationSearchBarUpdate(e=> {
416
+
useNavigationSearchBarUpdate((e)=> {
416
417
console.log(`Seach bar text changed to ${e.text}${e.focussed?' (focussed)':''} on this screen`)
417
418
})
418
419
419
420
// Listen events only for this screen by providing componentId as paramenter
420
421
useNavigationSearchBarUpdate(
421
-
e=> {
422
+
(e)=> {
422
423
console.log(`Seach bar text changed to ${e.text}${e.focussed?' (focussed)':''} on this screen`)
423
424
},
424
425
{ componentId }
425
426
)
426
427
427
428
// Global event handler. You should probably never use this but just in case.
428
429
useNavigationSearchBarUpdate(
429
-
e=> {
430
+
(e)=> {
430
431
console.log(
431
432
`Seach bar text changed to ${e.text}${e.focussed?' (focussed)':''} on componentId: ${e.componentId}`
432
433
)
@@ -447,21 +448,21 @@ import { useNavigationSearchBarCancelPress } from 'react-native-navigation-hooks
447
448
448
449
const ScreenComponent = ({ componentId }) => {
449
450
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider> (if neither of those are provided it will warn you at least you provide a `{ global: true}` option)
450
-
useNavigationSearchBarCancelPress(e=> {
451
+
useNavigationSearchBarCancelPress((e)=> {
451
452
console.log('Seach bar cancel button pressed on this screen')
452
453
})
453
454
454
455
// Listen events only for this screen by providing componentId as paramenter
455
456
useNavigationSearchBarCancelPress(
456
-
e=> {
457
+
(e)=> {
457
458
console.log('Seach bar cancel button pressed on this screen')
458
459
},
459
460
{ componentId }
460
461
)
461
462
462
463
// Global event handler. You should probably never use this but just in case.
463
464
useNavigationSearchBarCancelPress(
464
-
e=> {
465
+
(e)=> {
465
466
console.log(`Seach bar cancel button pressed on componentName: ${e.componentName}`)
466
467
},
467
468
{ global: true }
@@ -480,21 +481,21 @@ import { useNavigationPreviewComplete } from 'react-native-navigation-hooks'
480
481
481
482
const ScreenComponent = ({ componentId }) => {
482
483
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider> (if neither of those are provided it will warn you at least you provide a `{ global: true}` option)
483
-
useNavigationPreviewComplete(e=> {
484
+
useNavigationPreviewComplete((e)=> {
484
485
console.log(`Preview component ${e.previewComponentId} shown on this screen`)
485
486
})
486
487
487
488
// Listen events only for this screen by providing componentId as paramenter
488
489
useNavigationPreviewComplete(
489
-
e=> {
490
+
(e)=> {
490
491
console.log(`Preview component ${e.previewComponentId} shown on this screen`)
491
492
},
492
493
{ componentId }
493
494
)
494
495
495
496
// Global event handler. You should probably never use this but just in case.
496
497
useNavigationPreviewComplete(
497
-
e=> {
498
+
(e)=> {
498
499
console.log(`Preview component ${e.previewComponentId} shown on ${e.componentId}`)
0 commit comments