mergeProps
Edit this pageimport { mergeProps } from "solid-js"
function mergeProps(...sources: any): any
A reactive object merge method. Useful for setting default props for components in case caller doesn't provide them. Or cloning the props object including reactive properties.
This method works by using a proxy and resolving properties in reverse order. This allows for dynamic tracking of properties that aren't present when the prop object is first merged.
// default propsprops = mergeProps({ name: "Smith" }, props)
// clone propsnewProps = mergeProps(props)
// merge propsprops = mergeProps(props, otherProps)