MCPcopy Create free account
hub / github.com/TanStack/router / renderScripts

Function renderScripts

packages/solid-router/src/Scripts.tsx:63–84  ·  view source on GitHub ↗
(
  router: ReturnType<typeof useRouter>,
  scripts: Array<RouterManagedTag>,
  assetScripts: Array<RouterManagedTag>,
)

Source from the content-addressed store, hash-verified

61}
62
63function renderScripts(
64 router: ReturnType<typeof useRouter>,
65 scripts: Array<RouterManagedTag>,
66 assetScripts: Array<RouterManagedTag>,
67) {
68 const allScripts = [...scripts, ...assetScripts] as Array<RouterManagedTag>
69
70 if ((isServer ?? router.isServer) && router.serverSsr) {
71 const serverBufferedScript = router.serverSsr.takeBufferedScripts()
72 if (serverBufferedScript) {
73 allScripts.unshift(serverBufferedScript)
74 }
75 }
76
77 return (
78 <>
79 {allScripts.map((asset) => (
80 <Asset {...asset} />
81 ))}
82 </>
83 )
84}

Callers 1

ScriptsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected