Life Cycle Methods

Yugal has 2 Life Cycle method for page methods.

  • willMount : This method runs before renderring code to page.

  • onMount: This method runs after mounting code to page. Both are passed as parameter in object which page method returns. Example

    function HomePage(){
        return{
            render: `<h1>SOME CODE!</h1>`,
            uri: 'index',
            onMount: ()=>{
                console.log('AFTER MOUNTING');
            },
            willMount: ()=>{
                console.log('BEFORE MOUNTING');
            }
        };
    }

Last updated

Was this helpful?