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

fix(gatsby-plugin-image): Fix image rendering issues #30097

Closed
wants to merge 3 commits into from

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Mar 8, 2021

We were previously setting the sizer with dangerouslySetHTML before hydration, but this was causing rendering issues such as #29982, #30052 and #30024. This PR switches to rendering an empty layout wrapper as the placeholder instead. This is going to need some checking, as @laurieontech I know you did it like that for a reason!
This also no longer conditionally renders the placeholder, as this was causing a flicker, e.g. #29911. I can no longer reproduce the issue that was the reason I originally made this change, which was the blur-up happening even when an image was already loaded. If it returns, we should try fixing it with React.memo instead. Please let me know if you have a repro of that original issue.

@ascorbic ascorbic added the topic: media Related to gatsby-plugin-image, or general image/media processing topics label Mar 8, 2021
@ascorbic ascorbic requested a review from laurieontech March 8, 2021 11:40
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 8, 2021
@ascorbic ascorbic removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 8, 2021
@laurieontech
Copy link
Contributor

Let's get in the placeholder fix for now. I'm looking into the state issues, but relying on react for initial layout is something we don't want to do.

@ascorbic ascorbic closed this Mar 10, 2021
@vladar
Copy link
Contributor

vladar commented Mar 10, 2021

@ascorbic Should we just remove it from the V3 fixes project or there is an alternative PR?

@laurieontech
Copy link
Contributor

@wardpeet is finishing up an alternative.

@vladar
Copy link
Contributor

vladar commented Mar 10, 2021

OK, I've removed this one from the project for now. We'll add the alternative one instead.

@LekoArts LekoArts deleted the fix/placeholder-flicker branch July 2, 2021 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants