File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -81,21 +81,17 @@ function enrichPageRef(
81
81
82
82
if ( isContent ) {
83
83
pageRef . current . slug = getContentSlug ( { match, history, location, pageRef } )
84
- }
85
84
86
- if (
87
- isContent &&
88
- ! pageRef . current . ContentComponent &&
89
- ! pageRef . current . PageComponent
90
- ) {
91
- const ContentComponent = props => {
92
- const Component = pageRef . current . module . default
93
- const element = < Component { ... props } />
94
- return applyHook ( 'wrapContentElement' , { element , props } , 'element' )
85
+ if ( ! pageRef . current . ContentComponent && ! pageRef . current . PageComponent ) {
86
+ const ContentComponent = props => {
87
+ const Component = pageRef . current . module . default
88
+ const element = < Component { ... props } />
89
+ return applyHook ( 'wrapContentElement' , { element , props } , 'element' )
90
+ }
91
+ const PageComponent = ( ) => < Content Component = { ContentComponent } />
92
+ pageRef . current . ContentComponent = ContentComponent
93
+ pageRef . current . PageComponent = PageComponent
95
94
}
96
- const PageComponent = ( ) => < Content Component = { ContentComponent } />
97
- pageRef . current . ContentComponent = ContentComponent
98
- pageRef . current . PageComponent = PageComponent
99
95
} else {
100
96
pageRef . current . PageComponent = pageModule . default
101
97
}
You can’t perform that action at this time.
0 commit comments