react-solid-flow
Version:
[SolidJS](https://www.solidjs.com/docs/latest/api#control-flow)-inspired basic control-flow components and everyday async state hook library for [React](https://reactjs.org/)
11 lines (10 loc) • 403 B
TypeScript
import { ReactElement, ReactNode } from "react";
interface MatchProps<T> {
/** predicate */
when: T | undefined | null | false;
/** content (or renderProp) to display if predicate is truthy */
children?: ((item: T) => ReactNode) | ReactNode;
}
/** Single branch of Switch component. */
export declare function Match<T>({ when, children }: MatchProps<T>): ReactElement | null;
export {};