Home > @unseenco/backstage-core > ISheetObject > addProps
ISheetObject.addProps() method
Add new props to this object's config. Existing props are preserved; only the keys in config are added. Throws if a key already exists on the object.
Signature:
typescript
addProps(config: UnknownShorthandCompoundProps, opts?: {
transient?: readonly TransientPropPath[];
static?: readonly StaticPropPath[];
}): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| config | UnknownShorthandCompoundProps | |
| opts | { transient?: readonly TransientPropPath\[\]; static?: readonly StaticPropPath\[\]; } |
Returns:
void
Example
ts
const obj = sheet.object('Box', {x: 0})
obj.addProps({y: 0})
// obj now has props x and y