A simple and effective approach
const editor = wp.data.select('core/editor');
const imageId = editor.getEditedPostAttribute('featured_media');
const imageObj = wp.data.select('core').getMedia(imageId);
ImageObj gives you a reasonable amount of image data to work with.
Related Posts:
- How to extend the gallery block in Gutenberg?
- Set default image link target in Gutenberg image block
- WordPress adding scaled images that don’t exist (1536×1536 and 2048×2048)
- get_post_gallery with Gutenberg
- How to include externally hosted images into a gallery block
- Apply image width to tag
- How to link Gutenberg Gallery images To Media file automatically?
- Find posts without featured image? [duplicate]
- How to get relative URL of medium sized featured image?
- How to set the width and height rule for featured image
- How to Add extra option to Image Block Settings?
- @wordpress/create-block image url in css
- How to remove buttons from gutenberg toolbar
- Extend core block attributes in post content
- hardcrop images in gutenberg “latest posts” block
- Bulk edit Gutenberg single images to change from linking to media file to attachment page
- Trying to create a mouseover effect in html using Gutenberg editor
- Big Image on Featured Post, Normal on Single Post
- How to use photo in multiple posts?
- Prevent Image Pasting in RichText Component
- Multiple amp-image overlays. How to properly do this in wordpress?
- Update an image block style programatically
- Add width & height attributes to Gutenberg’s image output?
- update_post_meta attachment_image_alt description for Gutenberg
- Setup Featured image on all posts from thesis thesis_post_image custom field?
- How to get the Gallery form/section just like in Gutenberg block?
- Is there a wordpress filter to edit the markup of inline images?
- How to upload and style svg logo?
- Weird failing request
- How can I check if the first block is an image aligned left or right?
- Not seeing text alignment option in Image block
- How do I link a featured photo to it’s post?
- Place image caption outside of figure tag (Gutenburg Image Markup)
- Change Image Size option in the settings in bulk
- How to disable a WP Image Block to link to itself?
- get_post_gallery with Gutenberg
- How to join Caption AND Description Meta Fields as one combined-caption in Image Block
- Using srcsets in a custom block
- Rebuilding core image block
- A query to substitute images paths in gutenberg (website migration)?
- Convert multiple image blocks to gallery block in Gutenberg?
- get_post_gallery with Gutenberg
- Title image is missing ( but is not the WP 3.5 issue )
- Custom filename when pasting an image from clipboard
- Orientation of featured image in post?
- How to show file size of featured image? [duplicate]
- How to show file type of featured image?
- Multisite image URLs incorrect in editor
- Gutenberg block HTML image rendering override
- Get field added via attachment_fields_to_edit filter in Gutenberg
- Define how an attached image is rendered
- Adding or replacing image size
- [Solved]: Extend the list view in gutenberg editor?
- Separate Media Library for each user
- Bulk edit wordpress images alt and title attributes
- Separate attachment images from post loop
- alt, title tags not showing
- Why can’t I edit certain images from the WordPress Media library?
- How can I store an image in the database with Transients API?
- WordPress url image redirect to the homepage
- Custom page template to display all image attachments
- HTML tags in WordPress image caption
- Creating page templates with image placeholders
- Site migration – some images not displaying in Media Library
- add media button is not working
- Undefined index: sui_image_caption in [closed]
- Replacing the content of an image attachment using API
- User-uploaded images without an account
- Uploaded images not displaying in network site
- Should I not compress my jpeg files before uploading to avoid double compression?
- Generating a certain sized thumbnail on the fly?
- Only make custom image size if uploaded via Thickbox and attached to certain page
- Link listings with image
- After Migration, images show up on a preview of the page but not the actual page [closed]
- How to apply image alt descriptions from media library?
- Specify automatically the height and weight of the images
- How to crop images in a certain size only for a certain page?
- How to pass on a value as parameter via url to another page
- Using different size thumbnails on different parts of my site… with functions.php?
- Hover a css icon width other color inside wp_get_attachment_image
- Pictures randomly replaced by blue question mark
- How to skip the creation of landscape thumbnails for an original portrait image
- Why are my button images blurry on mobile screens?
- Broken imges after moving wordpress website from localhost to server [closed]
- How to regularly backup and update WordPress website with lot of images?
- Resize images to match CSS
- How to put images into theme from server folder (not from media library)
- How can I stop WP Image Editor upscaling from looking so pixellated?
- Select image and display from textfield?
- add_image_size() width not actually working
- (Dynamically) Decrease the actual image size for downloads
- wordpress images not display [closed]
- Parallax image problem
- While doing a bulk upload the Media Images are showing blank?
- Get content from one WordPress website to another
- How to get WordPress to resize images for srcset?
- How to give path to image in wordpress?
- Edit multiple posts featured image
- Remove srcset thumbnail attribute for products in the WooCommerce shopping cart
- Images Not Displaying On Page or Media Gallery After Multisite Migration