Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@garage-panda/use-await-dom-render

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@garage-panda/use-await-dom-render

React hook that is used to await all DOM elements inside a node to be rendered

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

use-await-dom-render

About

A React hook that waits for all elements in an HTML node to be rendered and visible in the Node.

Install

npm i @garage-panda/use-await-dom-render

Example

import { useAwaitDomRender } from "@garage-panda/use-await-dom-render";

function App() {
  const [observer, startWait] = useAwaitDomRender();

  useLayoutEffect(() => {
    const targetNode = document.querySelector('#container-component');
    
    startWait(targetNode);
    
    observer.on('load', () => {
      console.log('All DOM elements rendered');
    });
  }, []);

  return (
    <div id="container-component">
      <SomeHeavySlowContent />
      <OtherContent />
    </div>
  );
}

Keywords

FAQs

Package last updated on 06 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc