-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add wrapperProps for <span> #70
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
wrapperProps
is needed here. This is the placeholder span, which is different from the wrapper span. The placeholder span is wrapped by the wrapper span and it gets replaced once the component or image are loaded. Hope it's not too confusing. 🙂There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool - I will get this changed this weekend. Thanks for the feedback!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Aljullu
Question about a bit of the code. What's the reasoning behind:
It looks like all the other use cases get wrapped in the
<span/>
except for the ones that fall inside that conditional. I'm wondering if someone is using a placeholder and would expect it to also be wrapped in the span and have the wrapper props applied? If not, then I can just add a note in the documentation for that. If those elements should also wrap the placeholder span, then I can make that update too.I just wanted to get your thoughts before making any code changes. ✌️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct, the wrapper is only needed to display the placeholder image or when there is an effect. Otherwise, there is no need to render it.
Yeah, we should make it clear the wrapper is only rendered when
placeholderSrc
oreffect
props are defined. Checking the docs,wrapperClassName
already has an explanation for it, but we could expand it if it's not clear.Hope that helps @johnstonbl01.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it twice, to reduce confusion it might make sense to rewrite the check you posted as:
So if
wrapperClassName
orwrapperProps
are defined, the wrapper is rendered. I think that might be less confusing, thoughts?Feel free to handle it in this PR or I can open a new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense to me. I'll take care of it in this PR - thanks for the clarification! I should be able to get to this tomorrow. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - should be good to go now on these changes.
wrapperProps
to reflect that the wrapping span is rendered when usingplaceholderSrc
andeffect
If I missed anything, please let me know!