Skip to content

Commit b3a735b

Browse files
committed
docs: correct forceHydration type in the readme
1 parent ac0f1e4 commit b3a735b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const CardWithHydrationOnDemand = withHydrationOnDemand({ on: ["visible"] })(
3434
//Hydrate when the browser's event loop is idle
3535
const CardWithHydrationOnDemand = withHydrationOnDemand({ on: ["idle"] })(Card);
3636

37-
//Hydrate after delay (by default: 2000ms)
37+
//Hydrate after a delay (by default: 2000ms)
3838
const CardWithHydrationOnDemand = withHydrationOnDemand({ on: ["delay"] })(
3939
Card
4040
);
@@ -49,11 +49,14 @@ const CardWithHydrationOnDemand = withHydrationOnDemand({
4949
on: [["scroll", document]]
5050
})(Card);
5151

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
5353
const CardWithHydrationOnDemand = withHydrationOnDemand({
5454
on: ["idle", "visible"]
5555
})(Card);
5656

57+
//Never hydrate unless forceHydrate is set to true in the props
58+
const CardWithHydrationOnDemand = withHydrationOnDemand()(Card);
59+
5760
//...
5861

5962
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
7275
#### `on: Array`
7376

7477
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]`.
7679

7780
```js
7881
import withHydrationOnDemand from "react-hydration-on-demand";
@@ -136,6 +139,6 @@ export default class App extends React.Component {
136139
}
137140
```
138141

139-
#### `forceHydration: Object` (optional)
142+
#### `forceHydration: Boolean` (optional)
140143

141144
Force the hydration of the component.

0 commit comments

Comments
 (0)