Skip to content

Commit a6d11be

Browse files
authored
Update README.md
1 parent a2205ce commit a6d11be

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ npm install react-intersection-observer --save
4242

4343
## Usage
4444

45-
### Hooks 🎣
46-
47-
#### `useInView`
45+
### `useInView` hook
4846

4947
```js
5048
// Use object destructing, so you don't need to remember the exact order
@@ -142,15 +140,14 @@ export default Component;
142140

143141
### Options
144142

145-
Provide these as props on the **`<InView />`** component or as the options
146-
argument for the hooks.
143+
Provide these as the options argument in the `useInView` hook or as props on the **`<InView />`** component.
147144

148145
| Name | Type | Default | Required | Description |
149146
| ---------------------- | ---------------------- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
150147
| **root** | `Element` | document | false | The IntersectionObserver interface's read-only root property identifies the Element or Document whose bounds are treated as the bounding box of the viewport for the element which is the observer's target. If the root is `null`, then the bounds of the actual document viewport are used. |
151148
| **rootMargin** | `string` | '0px' | false | Margin around the root. Can have values similar to the CSS margin property, e.g. "10px 20px 30px 40px" (top, right, bottom, left). |
152-
| **threshold** | `number` \| `number[]` | 0 | false | Number between 0 and 1 indicating the percentage that should be visible before triggering. Can also be an array of numbers, to create multiple trigger points. |
153-
| **trackVisibility** 🧪 | `boolean` | false | false | A boolean indicating whether this IntersectionObserver will track changes in a target’s visibility. |
149+
| **threshold** | `number` \| `number[]` | 0 | false | Number between `0` and `1` indicating the percentage that should be visible before triggering. Can also be an array of numbers, to create multiple trigger points. |
150+
| **trackVisibility** 🧪 | `boolean` | false | false | A boolean indicating whether this IntersectionObserver will track visibility changes on the target. |
154151
| **delay** 🧪 | `number` | undefined | false | A number indicating the minimum delay in milliseconds between notifications from this observer for a given target. This must be set to at least `100` if `trackVisibility` is `true`. |
155152
| **skip** | `boolean` | false | false | Skip creating the IntersectionObserver. You can use this to enable and disable the observer as needed. If `skip` is set while `inView`, the current state will still be kept. |
156153
| **triggerOnce** | `boolean` | false | false | Only trigger the observer once. |

0 commit comments

Comments
 (0)