mount
mount is Solid's hydrate function re-exported for the SolidStart client entry.
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.
Behavior
mountandhydrateare the same function.- The standard entry hydrates
<StartClient />into the document's#appelement.
Examples
Basic usage
import { mount, StartClient } from "@solidjs/start/client";
mount(() => <StartClient />, document.getElementById("app")!);