Class: CollectionComponent<P>
Defined in: src/sdk/components/CollectionComponent.tsx:20
A component that lets you add and remove children.
Extends
Extended by
Type Parameters
| Type Parameter |
|---|
P extends CollectionComponentProps |
Constructors
Constructor
new CollectionComponent<
P>(props):CollectionComponent<P>
Defined in: src/sdk/components/FSComponent.ts:73
Creates an instance of a DisplayComponent.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | P | The propertis of the component. |
Returns
CollectionComponent<P>
Inherited from
Properties
context?
optionalcontext: [] =undefined
Defined in: src/sdk/components/FSComponent.ts:64
The context on this component, if any.
Inherited from
contextType?
readonlyoptionalcontextType: readonly [] =undefined
Defined in: src/sdk/components/FSComponent.ts:67
The type of context for this component, if any.
Inherited from
props
props:
P&ComponentProps
Defined in: src/sdk/components/FSComponent.ts:61
The properties of the component.
Inherited from
Methods
addItem()
addItem(
node):string
Defined in: src/sdk/components/CollectionComponent.tsx:29
Add a new child element.
Parameters
| Parameter | Type | Description |
|---|---|---|
node | VNode | A VNode to add to the container. |
Returns
string
An identifier for the added element.
destroy()
destroy():
void
Defined in: src/sdk/components/FSComponent.ts:98
Destroys this component.
Returns
void
Inherited from
getContext()
protectedgetContext(context):never
Defined in: src/sdk/components/FSComponent.ts:106
Gets a context data subscription from the context collection.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | never | The context to get the subscription for. |
Returns
never
The requested context.
Throws
An error if no data for the specified context type could be found.
Inherited from
insertAfter()
insertAfter(
node,after):string
Defined in: src/sdk/components/CollectionComponent.tsx:61
Insert a child after an element.
Parameters
| Parameter | Type | Description |
|---|---|---|
node | VNode | The node to insert |
after | string | The element to insert after. |
Returns
string
An identifier for the added element.
insertBefore()
insertBefore(
node,before):string
Defined in: src/sdk/components/CollectionComponent.tsx:49
Insert a child before an element.
Parameters
| Parameter | Type | Description |
|---|---|---|
node | VNode | The node to insert |
before | string | The element to insert before. |
Returns
string
An identifier for the added element.
onAfterRender()
onAfterRender(
node):void
Defined in: src/sdk/components/FSComponent.ts:87
A callback that is called after the component is rendered.
Parameters
| Parameter | Type | Description |
|---|---|---|
node | VNode | The component's VNode. |
Returns
void
Inherited from
DisplayComponent.onAfterRender
onBeforeRender()
onBeforeRender():
void
Defined in: src/sdk/components/FSComponent.ts:80
A callback that is called before the component is rendered.
Returns
void
Inherited from
DisplayComponent.onBeforeRender
removeItem()
removeItem(
id):void
Defined in: src/sdk/components/CollectionComponent.tsx:39
Remove a child element.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The ID of the child to remove. |
Returns
void
render()
render():
VNode
Defined in: src/sdk/components/CollectionComponent.tsx:71
Render the element.
Returns
A VNode.