Skip to main content

Reactive Lifecycle

Even if a vanilla component is created, it cannot be applied to the framework as it is. This is because the usage method is different for each framework.

So, to support vanilla components in the framework, CFCs provide compatible adapters.

CFCs provide several lifecycles and functions, and can be applied to various frameworks by writing usage accordingly.

  • created: Lifecycle that occurs when a component is called (or created).
    • Initialize state, methods, and events to be exposed.
  • mounted: Lifecycle that occurs when a component is mounted.
    • Connect the events exposed with the events of the instance.
  • init: Lifecycle that occurs after registering an event in the mounted Lifecycle.
    • Initialize the instance.
  • destroy: Lifecycle that occurs when a component is destroying.
    • Disconnect the exposed event and remove the instance.