Skip to content
MohammadAli Arjomand edited this page Sep 6, 2023 · 3 revisions

SinglightJs has 2 Lifecycle hooks, beforeMount and afterMount. For use that's run this command

node singlighter make:hook beforeMount # or afterMount

This command, will create a file in ./Scripts/Hooks/beforeMount.js

export default function beforeMount() {
    // codes are here
}

For working hooks, open ./Scripts/Hooks/Fisher.js then import the Hook

import beforeMount from "./beforeMount.js";

And add it in the object

export default {
    beforeMount
};

NOTE This object will import in App.js on line 3 and pass to Singlight.hooks on line 7

Clone this wiki locally