()
| 14 | * begin to be inserted. |
| 15 | */ |
| 16 | export const Scripts = () => { |
| 17 | const router = useRouter() |
| 18 | const nonce = router.options.ssr?.nonce |
| 19 | |
| 20 | const scripts = Solid.createMemo( |
| 21 | (previous: Array<RouterManagedTag> | undefined) => { |
| 22 | const next = composeSsrBodyScripts( |
| 23 | getSsrBodyScriptParts( |
| 24 | router.stores.matches.get(), |
| 25 | router.ssr?.manifest, |
| 26 | nonce, |
| 27 | ), |
| 28 | ) |
| 29 | return previous ? replaceEqualDeep(previous, next) : next |
| 30 | }, |
| 31 | ) |
| 32 | const initialHydrationScripts = |
| 33 | (isServer ?? router.isServer) && router.serverSsr |
| 34 | ? router.serverSsr.takeInitialHydrationScriptTags() |
| 35 | : undefined |
| 36 | const tags = () => |
| 37 | initialHydrationScripts |
| 38 | ? composeSsrBodyScripts([scripts(), []], initialHydrationScripts) |
| 39 | : scripts() |
| 40 | return ( |
| 41 | <> |
| 42 | <Solid.For each={tags()}>{(asset) => <Asset {...asset} />}</Solid.For> |
| 43 | </> |
| 44 | ) |
| 45 | } |
nothing calls this directly
no test coverage detected