# react-preload-images

> React component for preloading(caching) images

Latest version **0.0.1** (published 2023-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-preload-images
pnpm add react-preload-images
yarn add react-preload-images
bun add react-preload-images
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2023-02-12 |
| First published | 2023-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | LeeMir |
| Maintainers | leemir |
| Keywords | react, react-component, image-preload, image-cache |

## Links

- npm: https://www.npmjs.com/package/react-preload-images
- Repository: https://github.com/LeeMir/react-preload-images
- Issues: https://github.com/LeeMir/react-preload-images/issues
- npm.io page: https://npm.io/package/react-preload-images

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2023-02-12

## README

# react-preload-images

```bash
This package is not stable!
```

## Introduction

React 이미지 캐싱

![image](./example.gif)

## Get Started

아직 npm 배포 X

## Type

여기서는 다음과 같은 형식을 사용합니다.

```typescript
interface IImagePreloader {
  imagePaths?: string[];
  imageUrls?: string[];
  fallback?: React.ReactElement;
  indicator?: React.ReactElement;
}
```

## Usage

```React
import { Outlet } from 'react-router-dom';
import { ImagePreloader } from 'react-preload-images';

import './App.css';

import img7 from './assets/images/react7.svg';
import img6 from './assets/images/react6.svg';
import img5 from './assets/images/react5.svg';
import img4 from './assets/images/react4.svg';
import img3 from './assets/images/react3.svg';
import img2 from './assets/images/react2.svg';
import img1 from './assets/images/react.svg';

const Root = () => {
  const imgs = [img1, img2, img3, img4, img5, img6, img7];
  return (
    <>
      <Outlet />
      <ImagePreloader
        imagePaths={imgs}
        fallback={<span>Loading!!!</span>}
        indicator={<span>Done</span>}
      />
    </>
  );
};
```

---
_Source: https://npm.io/package/react-preload-images · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
