Scripts

Scripts is a collection of scripts that can be used to build your app.
tsx
<Scripts />
tsx
<Scripts />


Usage

tsx
import { Html, Head, Body, Routes, FileRoutes, Scripts } from "solid-start";
 
export default function Root() {
return (
<Html lang="en">
<Head></Head>
<Body>
<Routes>
<FileRoutes />
</Routes>
<Scripts />
</Body>
</Html>
);
}
tsx
import { Html, Head, Body, Routes, FileRoutes, Scripts } from "solid-start";
 
export default function Root() {
return (
<Html lang="en">
<Head></Head>
<Body>
<Routes>
<FileRoutes />
</Routes>
<Scripts />
</Body>
</Html>
);
}

The Scripts component injects JavaScript on the page. This includes the script element for your JavaScript entry point, the inline script used to start hydration before JavaScript has loaded, and any resource serialization data available at the time the page is initially sent.

Removing the Scripts component allows your application to ship 0kb of JavaScript and rely on the shipped HTML to provide an interactive experience by leveraging native anchor links and our progressive-enhanced Form actions.