BemtvJS
Github
  • README
  • Getting started
  • Introducing Brackethtml
  • Creating components
  • Defining the template
  • Rendering
  • Styling the component
  • .css() methods
  • SuperComponent
  • Hooks
  • Handling events
  • Isolated and special variables
  • Component proxies
  • No “props”!
  • Functional components - onInst()
  • DOM Elements
  • Bindings
  • Transformation Functions
  • Router(automatic routing)
    • Capturing errors
    • useRouteControl()
  • Lazy components
  • Suspense
  • State management
  • Keeping the instance running
  • run() - For all
  • Checking available components
  • And that’s it
Powered by GitBook
On this page

Checking available components

To check if a component is available, we can use the hasComponent() method which accepts an argument that is the name of the component:

import { hasComponent } from "bemtv";

if (hasComponent("App")) {
  //...
}
Previousrun() - For allNextAnd that’s it

Last updated 2 years ago