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.2 to 0.0.3

3

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

@@ -11,2 +11,3 @@ "main": "lib/index.js",

"scripts": {
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1"

@@ -13,0 +14,0 @@ },

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

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