Skip to content
Permalink
Browse files

Update node-api.md (#1065)

* Update node-api.md

Use correct import for createSharedData.

* Update node-api.md
  • Loading branch information...
hellojere authored and tannerlinsley committed Mar 13, 2019
1 parent 9982160 commit 6ed6cdf9c3904f471e401b7afc91730194f4526d
Showing with 2 additions and 1 deletion.
  1. +2 −1 docs/node-api.md
@@ -156,7 +156,8 @@ These shared data fragments can be placed in any route's `sharedData` object. At
Consider a large and heavy menu structure that is present only on the blog portion of your site. In this case, the menu data should only be loaded on the pages that use it, and only once per session (cached), instead of on every page individually. First we would use the `createSharedData` function and pass the data we want to share between our routes. Then in each route, we can pass the result of our `createSharedData` call as a prop to the route's `sharedData` property. The shared data props will then be stored, served and cached only once per session and merged into the result of the routes `getData` result at runtime!

```javascript
import { createSharedData } from 'react-static'
// static.config.js
import { createSharedData } from 'react-static/node'
export default {
getRoutes: async () => {

0 comments on commit 6ed6cdf

Please sign in to comment.
You can’t perform that action at this time.