Skip to content

fix(image): resolve childImageSharp warnings for SVGs by spreading {.…#6992

Merged
Namanv0509 merged 2 commits intolayer5io:masterfrom
helper-uttam:fix/helper-uttam/svg-image-prop-spread
Oct 7, 2025
Merged

fix(image): resolve childImageSharp warnings for SVGs by spreading {.…#6992
Namanv0509 merged 2 commits intolayer5io:masterfrom
helper-uttam:fix/helper-uttam/svg-image-prop-spread

Conversation

@helper-uttam
Copy link
Copy Markdown
Contributor

Description
This PR fixes the warning messages related to childImageSharp when using SVG images like gsoc.svg. It updates the image component to spread {...rest} props on the <img> tag, ensuring consistency and proper handling of SVG images using publicURL instead of childImageSharp.

Notes for Reviewers

  • The change is minor and affects the image rendering component only.
  • Verified locally that the warnings are resolved.
  • This change does not affect any other image formats or functionality.
  • Please check if the approach aligns with project conventions.

Signed commits

  • Yes, I signed my commits.

…..rest} on <img>

Signed-off-by: helper-uttam <bajiraouttamsinha@gmail.com>
@l5io
Copy link
Copy Markdown
Member

l5io commented Oct 6, 2025

🚀 Preview for commit 0ed219c at: https://68e3e8aa694c745ab207c143--layer5.netlify.app

@amishhaa
Copy link
Copy Markdown
Contributor

amishhaa commented Oct 6, 2025

@helper-uttam you can consider adding the terminal images depicting the warnings were not raised, it would help others who are reviewing this pr, also a great proof of concept

@helper-uttam
Copy link
Copy Markdown
Contributor Author

Initial logs were containing repeating warnings

image

After passing {...rest} props

image

Copy link
Copy Markdown
Contributor

@Namanv0509 Namanv0509 left a comment

Choose a reason for hiding this comment

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

lgtm , thanks @helper-uttam

@Namanv0509 Namanv0509 merged commit c89d35b into layer5io:master Oct 7, 2025
2 of 4 checks passed
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.

5 participants