@garage-panda/use-await-dom-render
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"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> | ||
); | ||
} | ||
``` |
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
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
34
2667
3
0
2