Skip to content

kimfiedler/react-use-iframe-content-height

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-use-iframe-content-height

A React hook to poll an iframe for its 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" />
  );
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published