mount()
The mount() function is the starting line for every Cuek application. It takes your top-level Virtual Node and physically attaches it to the DOM. Until you call mount(), your code is just a beautiful idea.
Usage
import { mount } from "cuekjs";
import App from "./App";
// Attach the App to the #root element
mount(<App />, document.getElementById("root"));
Parameters
- vnode: The root JSX element of your application.
- container: (Optional) The target DOM element. If you leave this out, Cuek defaults to
document.body.
How it works
When you call mount(), Cuek recursively traverses your component tree, creating real DOM nodes as it goes. It also sets up the initial component contexts and registers any lifecycle hooks you have declared.
Once the initial render is complete, mount() clears the path for future updates via rerender().