Skip to main content

Component

📄️ Lifecycle

Sonnet JS components lifecycle is bit different from other frameworks. There are not typical lifecycle methods like componentDidMount, componentDidUpdate, etc. Instead, Sonnet JS handles all this stuff in a different way. In Sonnet JS, lifecycle is maintained at app level instead of component level. What it means is that component is rendered (mounted) only once (single page environment). As long as the page is not changed, the component will not be re-rendered. This is the reason why there is no need for lifecycle methods like componentDidMount, componentDidUpdate, etc.