Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the props passed in for the image #117

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

ingeniumed
Copy link
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 chriszarate and a team October 27, 2023 03:40
@@ -47,7 +46,8 @@ export default function Image ( props: Props ) {
return (
<NextImage
loader={loader}
{...imageProps}
Copy link
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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants