1 | import React from 'react';
|
2 |
|
3 | import Controller from './controller';
|
4 | import Wrap from './wrappedPage';
|
5 |
|
6 |
|
7 |
|
8 | export default class ReactController extends Controller {
|
9 | layout = null;
|
10 | page = null;
|
11 |
|
12 |
|
13 |
|
14 | render () {
|
15 | const { ctx } = this;
|
16 | const Page = this.page;
|
17 | const PageLayout = this.pageLayout;
|
18 |
|
19 | const props = ctx.props;
|
20 |
|
21 | let Layout;
|
22 |
|
23 | if (ctx.includeLayout && this.layout) {
|
24 | Layout = this.layout;
|
25 | }
|
26 |
|
27 | return (
|
28 | <Wrap
|
29 | { ...props }
|
30 | Layout={ Layout }
|
31 | PageLayout={ PageLayout }
|
32 | Page={ Page }
|
33 | key={ Math.random() }
|
34 | />
|
35 | );
|
36 | }
|
37 | }
|