@garage-panda/use-await-dom-render
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6939
9
120
0
1