mount

mount hydrates a client entry and includes island hydration handling.


Import

import { mount } from "@solidjs/start/client";

Type

function mount(
fn: () => JSX.Element,
el: MountableElement
): (() => void) | undefined;

Parameters

fn

  • Type: () => JSX.Element
  • Required: Yes

Function that returns the client app element.

el

  • Type: MountableElement
  • Required: Yes

Element used as the hydration root.


Return value

  • Type: (() => void) | undefined

Returns the value from hydrate for non-island builds. In island builds, it returns undefined.


Behavior

  • In non-island builds, hydrate is called with fn and el.
  • Island builds hydrate solid-island[data-hk] elements and do not call hydrate(fn, el).
  • CSS links listed in data-css are loaded when a matching link[href] is not already present.
  • Islands with data-when="idle" hydrate through requestIdleCallback when it exists.

Examples

Basic usage

import { mount, StartClient } from "@solidjs/start/client";
mount(() => <StartClient />, document.getElementById("app")!);

Last updated: 5/6/26, 4:10 AMEdit this pageReport an issue with this page