@snivio/react-image-loader
Version:
This Component Makes lazy loading images a breeze with both loading element and error element by taking care of loading and error handling within the element
32 lines (24 loc) • 687 B
Markdown
This Component Makes lazy loading images a breeze with both loading element and error element
by taking care of loading and error handling within the element
- Props
| Props | Description |
| -------- | ------------------- |
| loader | Loading element |
| error | error element |
| children | react child element |
```tsx
import { ImageLoader } from "./components";
function App() {
const src = "https://placehold.co/600x400";
return (
<>
<ImageLoader loader={"Loading"} src={src} error={"Error has occurred"}>
<img src={src} />
</ImageLoader>
</>
);
}
export default App;
```