You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Application-Web/src/App/react-display-file.php

59 lines
1.6 KiB

<!doctype html>
<html lang="en">
<head>
<script type="module">
<?php
if (SUPPORTS_FAST_REFRESH) {
$asset_server = asset("");
echo "
import RefreshRuntime from '{$asset_server}front/@react-refresh'
RefreshRuntime.injectIntoGlobalHook(window)
window.\$RefreshReg$ = () => {}
window.\$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
";
}
?>
</script>
<link rel="icon" href="<?= asset("assets/favicon.ico") ?>">
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<!-- remove default screen margin,
html and body to take full screen size -->
<style>
body, html, #root {
height: 100%;
width: 100%;
margin: 0;
overflow: hidden;
}
</style>
</head>
<body>
<div id="root"></div>
<!--
here's the magic.
imports the given view URL, and assume that the view exports a function named `Component`.
see ViewRenderer.tsx::renderView for more info
-->
<script type="module">
import {renderView} from "<?= asset("ViewRenderer.tsx") ?>"
import Component from "<?= asset($url) ?>"
renderView(Component, <?= json_encode($arguments) ?>)
</script>
<script>
</script>
</body>
</html>