
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
react-image-loader-hoc
Advanced tools
React High Order Component (HOC) to handle Image Components pre-loading state and onLoad error state
React-Image-Loader-HOC is a High Order Component that allows you to enhance your React Image Component by adding features to handle the loading of the image source in an elegant way.
$ yarn add react-image-loader-hoc
or
$ npm install --save react-image-loader-hoc
import React, { Component } from 'react';
import withImageLoader from 'react-image-loader-hoc';
const Image = props => (<img alt="" {...props} />);
const ImageWithLoader = withImageLoader(Image);
class App extends Component {
render() {
return (
<div>
<ImageWithLoader
src="https://edmullen.net/test/rc.jpg"
width="400px"
height="200px"
/>
</div>
);
}
}
| Prop | Type | Required | Description | Default |
|---|---|---|---|---|
| src | String | Yes | Image url | - |
| onLoad | Function | No | Callback when load is successful | - |
| onError | Function | No | Callback when load fails | - |
| loaderComp | Component | No | Custom React component to be displayed while loading | - |
| errorComp | Component | No | Custom React component to be displayed on Error | - |
| fadeIn | Boolean | No | Load the image with Fade In effect | True |
You want to see some examples? Go to Online Demo
FAQs
React High Order Component (HOC) to handle Image Components pre-loading state and onLoad error state
The npm package react-image-loader-hoc receives a total of 134 weekly downloads. As such, react-image-loader-hoc popularity was classified as not popular.
We found that react-image-loader-hoc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.