Class: CollectionComponent<P>
A component that lets you add and remove children.
Type parameters
Name | Type |
---|---|
P | extends CollectionComponentProps |
Hierarchy
↳
CollectionComponent
Constructors
constructor
• new CollectionComponent<P
>(props
): CollectionComponent
<P
>
Creates an instance of a DisplayComponent.
Type parameters
Name | Type |
---|---|
P | extends CollectionComponentProps |
Parameters
Name | Type | Description |
---|---|---|
props | P | The propertis of the component. |
Returns
Inherited from
Defined in
src/sdk/components/FSComponent.ts:73
Properties
context
• Optional
context: [] = undefined
The context on this component, if any.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:64
contextType
• Optional
Readonly
contextType: readonly [] = undefined
The type of context for this component, if any.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:67
props
• props: P
& ComponentProps
The properties of the component.
Inherited from
Defined in
src/sdk/components/FSComponent.ts:61
Methods
addItem
▸ addItem(node
): string
Add a new child element.
Parameters
Name | Type | Description |
---|---|---|
node | VNode | A VNode to add to the container. |
Returns
string
An identifier for the added element.
Defined in
src/sdk/components/CollectionComponent.tsx:29
destroy
▸ destroy(): void
Destroys this component.
Returns
void
Inherited from
Defined in
src/sdk/components/FSComponent.ts:98
getContext
▸ getContext(context
): never
Gets a context data subscription from the context collection.
Parameters
Name | 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
Defined in
src/sdk/components/FSComponent.ts:106
insertAfter
▸ insertAfter(node
, after
): string
Insert a child after an element.
Parameters
Name | Type | Description |
---|---|---|
node | VNode | The node to insert |
after | string | The element to insert after. |
Returns
string
An identifier for the added element.
Defined in
src/sdk/components/CollectionComponent.tsx:61
insertBefore
▸ insertBefore(node
, before
): string
Insert a child before an element.
Parameters
Name | Type | Description |
---|---|---|
node | VNode | The node to insert |
before | string | The element to insert before. |
Returns
string
An identifier for the added element.
Defined in
src/sdk/components/CollectionComponent.tsx:49
onAfterRender
▸ onAfterRender(node
): void
A callback that is called after the component is rendered.
Parameters
Name | Type | Description |
---|---|---|
node | VNode | The component's VNode. |
Returns
void
Inherited from
DisplayComponent.onAfterRender
Defined in
src/sdk/components/FSComponent.ts:87
onBeforeRender
▸ onBeforeRender(): void
A callback that is called before the component is rendered.
Returns
void
Inherited from
DisplayComponent.onBeforeRender
Defined in
src/sdk/components/FSComponent.ts:80
removeItem
▸ removeItem(id
): void
Remove a child element.
Parameters
Name | Type | Description |
---|---|---|
id | string | The ID of the child to remove. |
Returns
void
Defined in
src/sdk/components/CollectionComponent.tsx:39
render
▸ render(): VNode
Render the element.
Returns
A VNode.
Overrides
Defined in
src/sdk/components/CollectionComponent.tsx:71