Summary
Add a loadgo-react package providing an idiomatic React API over the existing vanilla JS core.
Motivation
The vanilla JS implementation already works in React via useEffect/useRef, but users have to manually handle init/destroy lifecycle and cleanup. A dedicated hook removes that boilerplate.
Proposed API
// Hook
const { setprogress, getprogress, resetprogress, loop, stop } = useLoadgo(ref, options)
// Optionally a component wrapper
<LoadgoImage src="..." progress={42} options={...} />
Notes
Summary
Add a
loadgo-reactpackage providing an idiomatic React API over the existing vanilla JS core.Motivation
The vanilla JS implementation already works in React via
useEffect/useRef, but users have to manually handleinit/destroylifecycle and cleanup. A dedicated hook removes that boilerplate.Proposed API
Notes
loadgo-vanilla.js— no reimplementation of core logicreactandloadgo(vanilla) as peer dependenciesloadgo-reactnpm package