-
Notifications
You must be signed in to change notification settings - Fork 0
Lifecycle
Neila edited this page Aug 13, 2024
·
1 revision
Use addLifecycleEvent
to add lifecycle hooks.
The mount event is triggered when the component is first rendered.
function Foo() {
addLifecycleEvent("mount", () => {
// ...
});
}
The Unmount event is triggered when a component is about to be unmounted.
function Foo() {
addLifecycleEvent("unmount", () => {
// ...
});
}