Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix replaceHydrateFunction doc #5175

Merged
merged 2 commits into from
Apr 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions packages/gatsby/src/utils/api-browser-docs.js
Original file line number Diff line number Diff line change
@@ -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