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 - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

lib/DomObserver.d.ts

2

package.json
{
"name": "@garage-panda/use-await-dom-render",
"version": "0.0.3",
"version": "0.0.4",
"description": "React hook that is used to await all DOM elements inside a node to be rendered",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -1,33 +0,1 @@

# 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
```typescript
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>
);
}
```
# use-await-dom-render
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