Skip to content

Commit 0eb2812

Browse files
committed
feat(docs): apply PR feedback
1 parent 6878059 commit 0eb2812

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ You can take advantage of the [withNavigationProvider](#withNavigationProvider)
4343

4444
```tsx
4545
import { Navigation } from 'react-native-navigation'
46-
import { ComponentIdContext } from 'react-native-navigation-hooks'
46+
import { withNavigationProvider, NavigationProvider } from 'react-native-navigation-hooks'
4747

4848
Navigation.registerComponent('MyScreenComponent', () => withNavigationProvider(MyScreenComponent))
4949

@@ -111,7 +111,8 @@ Called each time this component appears on screen (attached to the view hierarch
111111
import { useNavigationComponentDidAppear } from 'react-native-navigation-hooks'
112112

113113
const ScreenComponent = ({ componentId }) => {
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+
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider>
115+
// (if neither of those are provided it will warn you at least you provide a `{ global: true }` option)
115116
useNavigationComponentDidAppear((e) => {
116117
console.log(`${e.componentName} appeared`)
117118
})
@@ -144,7 +145,8 @@ Called each time this component disappears from screen (detached from the view h
144145
import { useNavigationComponentDidDisappear } from 'react-native-navigation-hooks'
145146

146147
const ScreenComponent = ({ componentId }) => {
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)
148+
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider>
149+
// (if neither of those are provided it will warn you at least you provide a `{ global: true }` option)
148150
useNavigationComponentDidDisappear((e) => {
149151
console.log(`${e.componentName} appeared`)
150152
})
@@ -221,7 +223,8 @@ Invoked only on iOS pageSheet modal when swipeToDismiss flag is set to true and
221223
import { useNavigationModalAttemptedToDismiss } from 'react-native-navigation-hooks'
222224

223225
const ScreenComponent = ({ componentId }) => {
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)
226+
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider>
227+
// (if neither of those are provided it will warn you at least you provide a `{ global: true }` option)
225228
useNavigationModalAttemptedToDismiss((e) => {
226229
console.log(`Modal attempted dismissed on componentId: ${e.componentId}`)
227230
})
@@ -254,7 +257,8 @@ Invoked when modal dismissed. [more info](https://wix.github.io/react-native-nav
254257
import { useNavigationModalDismiss } from 'react-native-navigation-hooks'
255258

256259
const ScreenComponent = ({ componentId }) => {
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)
260+
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider>
261+
// (if neither of those are provided it will warn you at least you provide a `{ global: true }` option)
258262
useNavigationModalDismiss((e) => {
259263
console.log(`Modals dismissed: ${e.modalsDismissed} on componentId: ${e.componentId}`)
260264
})
@@ -287,7 +291,8 @@ Invoked when screen is popped. [more info](https://wix.github.io/react-native-na
287291
import { useNavigationScreenPop } from 'react-native-navigation-hooks'
288292

289293
const ScreenComponent = ({ componentId }) => {
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)
294+
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider>
295+
// (if neither of those are provided it will warn you at least you provide a `{ global: true }` option)
291296
useNavigationScreenPop((e) => {
292297
console.log(`Screen was popped on componentId: ${e.componentId}`)
293298
})
@@ -412,7 +417,8 @@ Called when a SearchBar from NavigationBar gets updated. [more info](https://wix
412417
import { useNavigationSearchBarUpdate } from 'react-native-navigation-hooks'
413418

414419
const ScreenComponent = ({ componentId }) => {
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)
420+
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider>
421+
// (if neither of those are provided it will warn you at least you provide a `{ global: true }` option)
416422
useNavigationSearchBarUpdate((e) => {
417423
console.log(`Seach bar text changed to ${e.text}${e.focussed ? ' (focussed)' : ''} on this screen`)
418424
})
@@ -447,7 +453,8 @@ Called when the cancel button on the SearchBar from NavigationBar gets pressed.
447453
import { useNavigationSearchBarCancelPress } from 'react-native-navigation-hooks'
448454

449455
const ScreenComponent = ({ componentId }) => {
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)
456+
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider>
457+
// (if neither of those are provided it will warn you at least you provide a `{ global: true }` option)
451458
useNavigationSearchBarCancelPress((e) => {
452459
console.log('Seach bar cancel button pressed on this screen')
453460
})
@@ -480,7 +487,8 @@ Called when preview peek is completed. [more info](https://wix.github.io/react-n
480487
import { useNavigationPreviewComplete } from 'react-native-navigation-hooks'
481488

482489
const ScreenComponent = ({ componentId }) => {
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)
490+
// Listen events only for this screen when using withNavigation HOC or <NavigationProvider>
491+
// (if neither of those are provided it will warn you at least you provide a `{ global: true }` option)
484492
useNavigationPreviewComplete((e) => {
485493
console.log(`Preview component ${e.previewComponentId} shown on this screen`)
486494
})

0 commit comments

Comments
 (0)