[]previous and next page

Match

Describes one branch of a Switch.

Describes one branch of a Switch. It returns its props unchanged.

Import#

ts
import { Match } from "@shadow-js/web";

Signature#

ts
function Match<T>(props: MatchProps<T>): MatchProps<T>

Parameters#

Name Description
props The condition and the branch content.

Returns#

The same props object, which Switch reads.

Examples#

ts
import { Match } from "@shadow-js/web";

const branch = Match({ when: "ready", children: "Loaded" });
console.log(branch.when); // "ready"