Skip to content

defaultProps

Applies default values to a props object. Reactive props are handled properly by ensuring that their value is not accessed by defaultProps, avoiding any unintended side effects.

import { defaultProps } from "@alloy-js/core";
function defaultProps<T extends {}>(props: T, defaults: Partial<T>): T;
propsT
defaultsPartial<T>

T