Skip to content

All JS modulepreload tags are within ROOT DIV element #21

Open
@jvenki

Description

Thanks for creating this wonderful library to enable Selective Hydration.

After this change, I find all the "modulepreload" link tags placed within our new <div id="root"> element. I am not sure why though Remix's Meta and Links are within the createHead method only.

export const Head = createHead(() => {
    const data = useRouteLoaderData<typeof loader>("root");
    return (
        <>
            <meta charSet="utf-8" />
            <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0, interactive-widget=resizes-content" />
            <meta name="robots" content="index, follow" />
            <Meta />
            <Links />
        </>
    );
});

I am also using Layout Export feature of Remix and my Layout is as follows

export function Layout({ children }: { children: React.ReactNode }) {
    return (
        <>
            <Head />
            {children}
            <ScrollRestoration />
            <Scripts />
        </>
    );
}

Is there anything I am doing wrong here? This is just placing the various modulepreload tags later when it should ideally have been in the head

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions