JSX is JavaScript, so normal conditions, functions and array operations can be used to decide what a component returns. A simple reactive condition can be written as a function, for example:
import { createSignal } from "@kayahr/signal";
function App() {
const [ loggedIn ] = createSignal(false);
return <main>
{() => loggedIn() ? <Dashboard /> : <Login />}
</main>;
}
Harmless also provides a small set of ready-made components for common rendering tasks. They make larger templates easier to read and provide the correct lifecycle and list-reuse behavior without requiring application code to manage DOM nodes itself.
When branch and falls back to an optional Otherwise branch.