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
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,16 +58,16 @@ The **`<Observer />`** accepts the following props:
58
58
|**root**| HTMLElement || false | The HTMLElement that is used as the viewport for checking visibility of the target. Defaults to the browser viewport if not specified or if null. |
59
59
|**rootId**| String || false | Unique identifier for the root element - This is used to identify the IntersectionObserver instance, so it can be reused. If you defined a root element, without adding an id, it will create a new instance for all components. |
60
60
|**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). |
61
-
|**tag**| String | 'div' | false | Element tag to use for the wrapping component |
61
+
|**tag**| String | 'div' | false | Element tag to use for the wrapping element when rendering using 'children'. Defaults to 'div'|
62
62
|**threshold**| Number | 0 | false | Number between 0 and 1 indicating the the percentage that should be visible before triggering. Can also be an array of numbers, to create multiple trigger points. |
63
63
|**triggerOnce**| Bool | false | false | Only trigger this method once |
64
64
|**onChange**| Func || false | Call this function whenever the in view state changes |
65
65
66
-
## Examples
66
+
## Usage
67
67
68
68
### Child as function
69
69
70
-
The default way to use the `Observer`, is to pass a function as the child. It
70
+
The easiest way to use the `Observer`, is to pass a function as the child. It
71
71
will be called whenever the state changes, with the new value of `inView`.
72
72
By default it will render inside a `<div>`, but you can change the element by setting `tag` to the HTMLElement you need.
73
73
@@ -107,7 +107,7 @@ export default Component
107
107
### OnChange callback
108
108
109
109
You can monitor the onChange method, and control the state in your own
110
-
component. The child node will always be rendered.
0 commit comments