UNPKG

@noema/motif

Version:

A type-safe styling library for React components built on top of [Vanilla Extract](https://vanilla-extract.style/). `@noema/motif` allows you to create styled components with consistent theme-aware props that cleanly separate styling from component logic.

7 lines (6 loc) 503 B
import type { ComponentPropsWithRef, ElementType, ReactElement, ReactNode } from 'react'; export type RenderProp<T> = ReactNode | ((props: T) => ReactElement); export type ComposedPrimitive<T, Element extends ElementType = 'div'> = Omit<ComponentPropsWithRef<Element>, 'children'> & { children?: RenderProp<T>; }; export declare function composeRender<T, U, V extends T>(value: T extends any ? T | ((renderProps: U) => V) : never, wrap?: (prevValue: T, renderProps: U) => V): (renderProps: U) => V;