feat(gatsby-image): Whitelist crossorigin prop for pass through to img tag#9758
Merged
wardpeet merged 4 commits intogatsbyjs:masterfrom Mar 15, 2019
Merged
Conversation
crossorigin prop for pass through to img tagcrossorigin prop for pass through to img tag
crossorigin prop for pass through to img tagcrossorigin prop for pass through to img tag
DSchau
reviewed
Dec 6, 2018
Contributor
DSchau
left a comment
There was a problem hiding this comment.
Sure - this seems reasonable.
More general question, since you just dived into the code. Does it make sense to stop maintaining this whitelist of valid image props, and rather be a little less selective and pluck the props we need, and pass others down appropriately?
In other words, there are several HTML attributes valid on the img tag and it may make more sense to just pass down and serialize appropriately, rather than explicitly handling each of these cases.
Contributor
|
lets revisit this in gatsby v3 where we can do lots of optimisations. I'll be merging this one |
wardpeet
reviewed
Mar 15, 2019
Contributor
|
@wconnorwalsh thank you for your patience! This went way to long! thanks for adding this feature! |
raffishquartan
pushed a commit
to raffishquartan/gatsby
that referenced
this pull request
Apr 28, 2026
…`img` tag (gatsbyjs#9758) * Whitelisted `crossorigin` prop for pass through to `img` tag * Updated typings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
crossoriginprop is occasionally needed on the rootimgtag to enable CORS requests.This PR passes that prop from
Imagetoimg, just as it already passes thealtandtitleprops.