How to use the hyperview/src/services.addHref 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 / index.js View on Github external
if (scrollable) {
    const scrollDirection = element.getAttribute('scroll-orientation');
    if (scrollDirection === 'horizontal') {
      props.horizontal = true;
    }
  }

  const component = React.createElement(
    c,
    props,
    ...Render.renderChildren(element, stylesheets, onUpdate, viewOptions),
  );
  return skipHref ?
    component :
    addHref(component, element, stylesheets, onUpdate, viewOptions);
}
github Instawork / hyperview / src / components / hv-view / index.js View on Github external
}

      const scrollDirection = element.getAttribute('scroll-orientation');
      if (scrollDirection === 'horizontal') {
        props.horizontal = true;
      }
    }

    const component = React.createElement(
      Component,
      props,
      ...Render.renderChildren(element, stylesheets, onUpdate, viewOptions),
    );
    return skipHref
      ? component
      : addHref(component, element, stylesheets, onUpdate, viewOptions);
  }
}
github Instawork / hyperview / src / components / hv-image / index.js View on Github external
const { element, stylesheets, onUpdate, options } = this.props;
    const { skipHref } = options || {};
    const imageProps = {};
    if (element.getAttribute('source')) {
      let source = element.getAttribute('source');
      source = urlParse(source, options.screenUrl, true).toString();
      imageProps.source = { uri: source };
    }
    const props = {
      ...createProps(element, stylesheets, options),
      ...imageProps,
    };
    const component = React.createElement(Image, props);
    return skipHref
      ? component
      : addHref(component, element, stylesheets, onUpdate, options);
  }
}
github Instawork / hyperview / src / index.js View on Github external
export function text(element, stylesheets, onUpdate, options) {
  const { skipHref } = options || {};
  const props = createProps(element, stylesheets, options);
  const component = React.createElement(
    Text,
    props,
    ...Render.renderChildren(element, stylesheets, onUpdate, options),
  );

  return skipHref ?
    component :
    addHref(component, element, stylesheets, onUpdate, options);
}