Skip to content

Initialize component

Anil Maharjan edited this page Dec 16, 2020 · 8 revisions

Instantiate Comfey - optionally passing a DOMElement as root of the component. By default document will be used.

import Comfey from 'comfey';
const myComponent = new Comfey(document.getElementById('my-component'));

The constructor also accepts the debug flag as the second argument.

 const COMFEY_DEBUG = false;
 const app = new Comfey(context, COMFEY_DEBUG);

Setting debug flag ON will add a Comfey debugger to your screen that allows you to monitor your states. Comfey Debugger


Read more on ← How to install Comfey | How to initialize Comfey State →