()
| 63 | } |
| 64 | |
| 65 | render() { |
| 66 | // Dump out our current props to a global object via a script tag so |
| 67 | // when initialising the browser environment we can bootstrap from the |
| 68 | // same props as what each page was rendered with. |
| 69 | const browserInitScriptObj = { |
| 70 | __html: 'window.INITIAL_PROPS = ' + JSON.stringify(this.props) + ';\n' |
| 71 | }; |
| 72 | |
| 73 | return ( |
| 74 | <html> |
| 75 | <head> |
| 76 | <meta charSet="utf-8" /> |
| 77 | <title>React DnD</title> |
| 78 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> |
| 79 | <link rel="stylesheet" type="text/css" href={this.props.files['main.css']} /> |
| 80 | <base target="_blank" /> |
| 81 | </head> |
| 82 | <body> |
| 83 | {this.state.renderPage && this.renderPage()} |
| 84 | |
| 85 | <script dangerouslySetInnerHTML={browserInitScriptObj} /> |
| 86 | <script src={this.props.files['main.js']}></script> |
| 87 | </body> |
| 88 | </html> |
| 89 | ); |
| 90 | } |
| 91 | |
| 92 | renderPage() { |
| 93 | switch (this.props.location) { |
nothing calls this directly
no test coverage detected