This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 787
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore getDataFromTree(rootElement, rootContext) API. (#2586)
In [email protected], the rootContext parameter was replaced by the custom renderFunction parameter, which was a breaking change: #2533 (comment) This commit restores the previous API, while providing an alternative API that is more flexible and more accurately named: getMarkupFromTree. If you want to specify a custom rendering function, you should now use getMarkupFromTree instead of getDataFromTree: import { getMarkupFromTree } from "react-apollo"; import { renderToString } from "react-dom/server"; getMarkupFromTree({ tree: <App/>, // optional; defaults to {} context: { ... }, // optional; defaults to renderToStaticMarkup renderFunction: renderToString, }).then(markup => { // Use the markup returned by the final rendering... }); Hopefully, since [email protected] was never assigned the `latest` tag on npm, we can push this change without another minor version bump. cc @evenchange4 @hwillson
- Loading branch information
Showing
4 changed files
with
105 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters