@@ -34,7 +34,7 @@ const CardWithHydrationOnDemand = withHydrationOnDemand({ on: ["visible"] })(
34
34
// Hydrate when the browser's event loop is idle
35
35
const CardWithHydrationOnDemand = withHydrationOnDemand ({ on: [" idle" ] })(Card);
36
36
37
- // Hydrate after delay (by default: 2000ms)
37
+ // Hydrate after a delay (by default: 2000ms)
38
38
const CardWithHydrationOnDemand = withHydrationOnDemand ({ on: [" delay" ] })(
39
39
Card
40
40
);
@@ -49,11 +49,14 @@ const CardWithHydrationOnDemand = withHydrationOnDemand({
49
49
on: [[" scroll" , document ]]
50
50
})(Card);
51
51
52
- // Hydrate when the when the browser's event loop is idle or when the user scroll, withever come first
52
+ // Hydrate when the when the browser's event loop is idle or when the user scroll, whichever comes first
53
53
const CardWithHydrationOnDemand = withHydrationOnDemand ({
54
54
on: [" idle" , " visible" ]
55
55
})(Card);
56
56
57
+ // Never hydrate unless forceHydrate is set to true in the props
58
+ const CardWithHydrationOnDemand = withHydrationOnDemand ()(Card);
59
+
57
60
// ...
58
61
59
62
export default class App extends React .Component {
@@ -72,7 +75,7 @@ If the component isn't rendered server side, it will render directly and behave
72
75
#### ` on: Array `
73
76
74
77
An array of events who will trigger the hydration.
75
- Can contains event names directly or array of 2 elements : ` ['event name', options] ` .
78
+ Can contains event names directly or if you want to pass options, as an array : ` ['event name', options] ` .
76
79
77
80
``` js
78
81
import withHydrationOnDemand from " react-hydration-on-demand" ;
@@ -136,6 +139,6 @@ export default class App extends React.Component {
136
139
}
137
140
```
138
141
139
- #### ` forceHydration: Object ` (optional)
142
+ #### ` forceHydration: Boolean ` (optional)
140
143
141
144
Force the hydration of the component.
0 commit comments