Skip to main content

Scripts

还没翻译译自英文(reactrouter.com)本页 12 段都还没译

Scripts

Framework

Summary

Reference Documentation ↗

Renders the client runtime of your app. It should be rendered inside the <body> of the document.

If server rendering, you can omit <Scripts/> and the app will work as a traditional web app without JavaScript, relying solely on HTML and browser behaviors.

import { Scripts } from "react-router";

export default function Root() {
  return (
    <html>
      <head />
      <body>
        <Scripts />
      </body>
    </html>
  );
}

Signature

function Scripts(scriptProps: ScriptsProps): React.JSX.Element | null

Props

scriptProps

Additional props to spread onto the <script> tags, such as crossOrigin, nonce, etc.

Traducción © 2026 fanyi.dev · Original © 2026 React Training LLC, Remix Software Inc., Shopify Inc. (MIT)