mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
- Fixes https://github.com/vercel/next.js/issues/54416 - Related to https://github.com/vercel/next.js/pull/47659 Co-authored-by: JJ Kasper <[email protected]>
38 lines
708 B
JavaScript
38 lines
708 B
JavaScript
import React from 'react'
|
|
import Image from 'next/image'
|
|
|
|
export const config = { runtime: 'experimental-edge' }
|
|
|
|
function loader({ src, width, quality }) {
|
|
return `${src}?wid=${width}&qual=${quality || 35}`
|
|
}
|
|
|
|
const Page = () => {
|
|
return (
|
|
<div>
|
|
<h1>Loader Config</h1>
|
|
<Image
|
|
id="img1"
|
|
alt="img1"
|
|
src="/logo.png"
|
|
width="400"
|
|
height="400"
|
|
priority
|
|
/>
|
|
<p>Scroll down...</p>
|
|
<div style={{ height: '100vh' }} />
|
|
<h2>Loader Prop</h2>
|
|
<Image
|
|
id="img2"
|
|
alt="img2"
|
|
src="/logo.png"
|
|
width="200"
|
|
height="200"
|
|
loader={loader}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Page
|