Pages
Introduction
Getting Started
Recipes
Reference
Literals
Arrays
Tuples
Type System
Functions
Modules
Records
Enums
Built-in Types
Constants
Equality
Stores
Routing
Comments
Control Expressions
Components
Properties
Computed Properties
Styling Elements
Connecting Stores
Using Providers
Internal State
Referencing Entities
Global Components
Lifecycle Functions
Directives
JavaScript Interop
Environment Variables
Packages
Lifecycle Functions
Components have the following lifecycle functions:
- componentDidMount - this is called when the component is mounted
- componentDidUpdate - this is called when the component is updated
- componentWillUnmount - this is called when the component is about to be unmounted
component Test {
fun componentDidMount : Promise(Never, Void) {
Debug.log("MOUNTED")
}
fun componentDidUpdate : Promise(Never, Void) {
Debug.log("UPDATED")
}
fun componentWillUnmount : Promise(Never, Void) {
Debug.log("WILL UNMOUNT")
}
fun render : Html {
<div>
"Hello!"
</div>
}
}