https://github.com/letieu/react-auto-height-image
Avoid zero height when load image
https://github.com/letieu/react-auto-height-image
Last synced: over 1 year ago
JSON representation
Avoid zero height when load image
- Host: GitHub
- URL: https://github.com/letieu/react-auto-height-image
- Owner: letieu
- Created: 2022-10-19T15:29:33.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-19T16:19:08.000Z (over 3 years ago)
- Last Synced: 2025-01-31T05:53:33.473Z (over 1 year ago)
- Language: JavaScript
- Size: 7.14 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-auto-height-image
Avoid zero height when loading image
[](https://github.com/letieu/react-auto-height-image/blob/master/ezgif.com-gif-maker.gif "demo")
**Example**: use my package on the **left** side
## Install
```bash
yarn add react-auto-height-image
#or
npm install react-auto-height-image
```
## Use
Use with your loading component
```jsx
}
/>
```
Use with fixed height
```jsx
```
## Props
```js
interface AutoHeightImageProps extends React.ImgHTMLAttributes {
loadingComponent?: React.ReactNode,
defaultHeight?: string,
}
```