Skip to content

Commit c9d96d6

Browse files
slorberKyleAMathews
authored andcommitted
Fix replaceHydrateFunction doc (#5175)
* Fix replaceHydrateFunction doc * Add spaces
1 parent c62e9fd commit c9d96d6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/gatsby/src/utils/api-browser-docs.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,14 @@ exports.wrapRootComponent = true
7575

7676
/**
7777
* Allow a plugin to replace the ReactDOM.render function call by a custom renderer.
78-
* This method receives the same parameters as ReactDOM.render takes.
79-
* Note it's very important to call the provided callback after rendering, otherwise Gatsby will not be able to call `onInitialClientRender`
80-
* @param {object} $0 element
81-
* @param {object} $1 container
82-
* @param {object} $2 callback
78+
* This method takes no param and should return a function with same signature as ReactDOM.render()
79+
* Note it's very important to call the callback after rendering, otherwise Gatsby will not be able to call `onInitialClientRender`
80+
* @example
81+
* exports.replaceHydrateFunction = () => {
82+
* return (element, container, callback) => {
83+
* console.log("rendering!");
84+
* ReactDOM.render(element, container, callback);
85+
* };
86+
* };
8387
*/
8488
exports.replaceHydrateFunction = true

0 commit comments

Comments
 (0)