React component to fetch image resources via web workers
react-worker-image is a React component for loading images via a web worker. Thereby not blocking the main thread and speeding up page load time.
npm install react-worker-imageyarn add react-worker-image
react-worker-image exports one react component which takes
src as a prop, and an optional prop of
imageClass which are applied to the img tag.
const ImageWorker = default;or;
usage in code
<ImageWorker ='' />
|placeholder||optional||string or Component|
The above props are applied to the img tag.
Found a bug file them here.
Component in Action
Observe the page Load time at the bottom right corner in both cases.
The first is via a webworker and the second is the regular get.