1.0.2 • Published 5 years ago

react-use-iframe-content-height v1.0.2

Weekly downloads
22
License
MIT
Repository
github
Last release
5 years ago

react-use-iframe-content-height

A React hook to poll an iframe for it's content height. It will only work if the parent and the source of the iframe are on the same domain.

Usage:

function MyIframe() {
  const [iframeRef, iframeHeight] = useIframeContentHeight();

  return (
    <iframe ref={iframeRef} height={iframeHeight} width="100%" src="/content" />
  );
}