Skip to main content

Viewless Components

In order create a component that is only logic and does not have a view i.e. Google Analytics Component that adds tracking info to page, you have to set it up as a "viewless" component.

Steps

  1. Add isViewless: true to component.config.json in your component project root.
// component.config.json
{
...
isViewless: true
}
  1. in your component's <component-name>.view.js file add this.setIsViewless(true) to the onInit lifecycle hook.
// <component-name>.view.js
onInit() {
this.setIsViewless(true);
}