Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Reduce the props passed in for the image#117

Open
ingeniumed wants to merge 1 commit into
trunkfrom
fix/image-bug-props
Open

Reduce the props passed in for the image#117
ingeniumed wants to merge 1 commit into
trunkfrom
fix/image-bug-props

Conversation

@ingeniumed

Copy link
Copy Markdown
Contributor

Description

Currently, the way the image props are built results in extra properties being set for the NextImage and the img. This results in warnings being published of unrecognized properties being set. So, this PR sets just the ones that should be necessary instead.

At the moment, that's just alt and src. Happy to add more if need be.

@ingeniumed ingeniumed self-assigned this Oct 27, 2023
@ingeniumed
ingeniumed requested review from a team and chriszarate October 27, 2023 03:40
return (
<NextImage
loader={loader}
{...imageProps}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ingeniumed Minor, but I noticed that we use the NextImage-specific property fill here on line 45:

<Image
alt={altText}
className={styles.image}
fill={true}
src={sourceUrl}
/>

which will get dropped by the changes. Is there a way to change things so Image still properly passes inner properties to NextImage?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants