Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e252bf4

Browse files
committed
Move stuff around
1 parent d08405f commit e252bf4

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

packages/gatsby/cache-dir/page-data-processors/asComponent.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react"
2-
import { getModule } from "gatsby"
32

4-
export default function asComponent(data) {
3+
export default function asComponent(data, { getModule }) {
54
if (data != null) {
65
const component = getModule(data.moduleId)
76
return (...additionalArgs) =>

packages/gatsby/cache-dir/page-renderer.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { createElement } from "react"
22
import PropTypes from "prop-types"
33
import { publicLoader } from "./loader"
44
import { apiRunner } from "./api-runner-browser"
5-
import processPageData from "./process-page-data"
65

76
// Renders page
87
class PageRenderer extends React.Component {
@@ -17,11 +16,6 @@ class PageRenderer extends React.Component {
1716
loader: publicLoader,
1817
})
1918

20-
processPageData(
21-
this.props.pageResources.pageProcessors,
22-
this.props.pageResources.json.data
23-
)
24-
2519
const pageElement =
2620
replacementElement ||
2721
createElement(this.props.pageResources.component, {

packages/gatsby/cache-dir/process-page-data.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ function runModulesOnPath(json, path, modules) {
2323
}
2424

2525
if (curr) {
26-
curr[path[0]] = modules.reduce((acc, next) => next(acc), curr[path[0]])
26+
curr[path[0]] = modules.reduce(
27+
(acc, next) => next(acc, { getModule }),
28+
curr[path[0]]
29+
)
2730
}
2831
}

packages/gatsby/cache-dir/production-app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ apiRunnerAsync(`onClientEntry`).then(() => {
7373
location,
7474
staticQueryData: pageResources.staticQueryData,
7575
})
76+
7677
processPageData(
7778
pageResources.pageProcessors,
7879
pageResources.json.data

0 commit comments

Comments
 (0)