![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@readr-media/image
Advanced tools
yarn add @readr-media/react-image
import CustomImage from '@readr-media/react-image'
const IMAGES_URL = { w400: "400.png", original: "original.png"}
export default function SomeComponent() {
return (
<div>
<OtherComponent/>
<CustomImage images={IMAGES_URL}/>
</div>
)
}
名稱 | 資料型別 | 必須 | 預設值 | 說明 |
---|---|---|---|---|
images | Object | V | {original: ""} | 圖片設定,範例: { w400: '400.png',w800 : '800.png', w1200: '1200.png', original: 'original.png' } 。會由w400 、w800 、w1200 、original 依序載入 |
defaultImage | String | "" | 預設圖片。當image 皆載入失敗時,則載入預設圖片。當 loadingImage 未傳入時,則以預設圖片作為圖片載入動畫效果。 | |
loadingImage | String | "" | 載入動畫效果,作為載入圖片的動畫。目前僅接受圖片檔URL。 | |
alt | String | "" | 替代文字 | |
objectFit | String | "cover" | 圖片區塊填滿設定,即為CSS property object-fit | |
height | String | "100%" | 圖片高度 | |
width | String | "100%" | 圖片寬度 | |
debugMode | Boolean | false | 是否開啟開發模式,若開啟,則在載入圖片成功或失敗時,透過console.log 顯示相關訊息 |
若使用該套件時,禁用了瀏覽器的cache,則同張圖片會載入兩次(一次在函式loadImage()
中載入各個大小的圖片,一次則在useEffect中,將成功載入的圖片掛載至<img>
上),這是正常的現象。
之所以要分載入兩次,而不是在loadImage()
中嘗試載入圖片並掛載至<img>
,是因為這樣才能在圖片載入時顯示loadingImage
。
若無禁用瀏覽器快取,則僅會載入一次圖片。
yarn install
$ yarn dev
// or
$ npm run dev
// or
$ make dev
$ npm run build
// or
$ make build
$ make build-dist
$ make build-lib
After executing Build
scripts, we will have ./dist
and /lib
folders,
and then we can execute publish command,
npm publish
Note: before publish npm package, we need to bump the package version first.
FAQs
Unknown package
We found that @readr-media/image demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.