Skip to content

Commit

Permalink
Fix replaceHydrateFunction doc (#5175)
Browse files Browse the repository at this point in the history
* Fix replaceHydrateFunction doc

* Add spaces
  • Loading branch information
slorber authored and KyleAMathews committed Apr 28, 2018
1 parent c62e9fd commit c9d96d6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/gatsby/src/utils/api-browser-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ exports.wrapRootComponent = true

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

0 comments on commit c9d96d6

Please sign in to comment.