How to use the hyperview/src.view function in hyperview

To help you get started, we’ve selected a few hyperview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Instawork / hyperview / src / services / render / index.js View on Github external
// XML comments don't get rendered.
    return null;
  }
  if (
    element.nodeType === NODE_TYPE.ELEMENT_NODE &&
    element.namespaceURI === Namespaces.HYPERVIEW
  ) {
    switch (element.localName) {
      case LOCAL_NAME.BODY:
      case LOCAL_NAME.VIEW:
      case LOCAL_NAME.FORM:
      case LOCAL_NAME.HEADER:
      case LOCAL_NAME.ITEM:
      case LOCAL_NAME.SECTION_TITLE:
        // TODO: Create HvView component
        return view(element, stylesheets, onUpdate, options);
      case LOCAL_NAME.TEXT:
        // TODO: Create HvText component
        return text(element, stylesheets, onUpdate, options);
      case LOCAL_NAME.BEHAVIOR:
      case LOCAL_NAME.MODIFIER:
      case LOCAL_NAME.STYLES:
      case LOCAL_NAME.STYLE:
        // Non-UI elements don't get rendered
        return null;
      default:
        break;
    }
  }

  if (element.nodeType === NODE_TYPE.ELEMENT_NODE) {
    if (!element.namespaceURI) {