渲染应用程序的客户端运行时。它应该呈现在文档的 <body>
中。
如果进行服务器端渲染,可以省略 <Scripts/>
,应用程序将像传统的没有 JavaScript 的网络应用程序一样工作,完全依赖 HTML 和浏览器行为。
import { Scripts } from "react-router";
export default function Root() {
return (
<html>
<head />
<body>
<Scripts />
</body>
</html>
);
}
function Scripts(scriptProps: ScriptsProps): React.JSX.Element | null
要扩展到 <script>
标签上的其他属性,例如 crossOrigin
、nonce
等。