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-19Lines changed: 4 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ The **`<Observer />`** accepts the following props:
113
113
|**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. |
114
114
|**triggerOnce**| Bool | false | false | Only trigger this method once |
115
115
|**onChange**| Func || false | Call this function whenever the in view state changes |
116
-
|**render**| Func || false |Use render method to only render content when inView |
/** Render prop boolean indicating inView state */
13
+
render?: (inView: boolean)=>React.Node,
12
14
/** 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. */
13
15
threshold?: number|Array<number>,
14
16
/** 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.*/
@@ -20,8 +22,6 @@ type Props = {
20
22
rootId?: string,
21
23
/** Call this function whenever the in view state changes */
22
24
onChange?: (inView: boolean)=>void,
23
-
/** Use render method to only render content when inView */
24
-
render?: ()=>React.Node,
25
25
/** Get a reference to the the inner DOM node */
26
26
innerRef?: Function,
27
27
}
@@ -134,9 +134,9 @@ class Observer extends React.Component<Props, State> {
134
134
ref: this.handleNode,
135
135
},
136
136
// If render is a function, use it to render content when in view
0 commit comments