-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 image block crash #65222
Fix image block crash #65222
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -6 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
const [ resizeListener, sizes ] = useResizeObserver(); P.S. The above syntax seems to be implicitly deprecated by #64943. It may be possible to refactor it in the future, including the Image block: gutenberg/packages/compose/src/hooks/use-resize-observer/index.ts Lines 87 to 90 in 6a60081
|
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 wonder if the placeholder observer can be unified with the max width observer 🤔. But that's okay for now I think 😅.
Too fast! ❤️ I'll close mine #65222 |
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.
Thanks. Also agree it's good for now, at least to unblock other PRs
Thanks for the review!
We discussed this in #64320 but found it difficult to integrate 😅 please see this comment. |
Thanks for fixing this so quickly! 🙇 |
Follow-up #64320
What?
This PR fixes a crash that occurs when an Image block is inserted.
Why?
This is because two PRs were merged at almost the same time 😅
In #64320, a new
useResizeObserver
hook was added to improve the Image block.This PR itself works correctly, but right after this PR was merged, #64819 was merged. In #64819, the
useResizeObserver
hook was removed, so the import statement no longer exists, causing a critical error.Testing Instructions
Make sure you can insert the image block correctly.