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
- Image size not showing up in ‘wp/v2/media’
- How to add images inside an item of a list in Gutenberg
- Adding or replacing image size
- Extend the list view in gutenberg editor?
- show hide image script after 4 seconds [closed]
- Restricting users to view only media library items they have uploaded?
- How do I disable responsive images in WP 4.4?
- Filter to remove image dimension attributes?
- How to get a list of all the possible thumbnail sizes set within a theme
- How do I get the avatar URL instead of an HTML IMG tag when using get_avatar?
- Image Upload from URL
- Programmatically adding images to media library
- How do I delete all UNUSED images from my uploads directory?
- Set default image sizes in WordPress to hard crop
- Is it possible set a featured image with external image URL
- get attachment title based on attachment id
- Stop wordpress from hardcoding img width and height attributes
- Handle issues with change of image scaling (rounding) in 4.1 (WP Ticket #18532)
- Programmatically get images by URL and save in uploads folder
- Prevent WordPress from generating medium_large 768px size of image uploads?
- remove or update add_image_size
- Get Image Description
- Image quality based on image size
- Function to get URL of original uploaded image – full size
- how to get original image using wp_get_attachment_image_src
- What is a good alternative to using $content_width for image optimization?
- get the attachement url for the medium sized image
- Can I attach image to post without adding it to post?
- Automatically replace original uploaded image with large image size
- WordPress crop tool greyed out
- How to scale up featured post thumbnail?
- Upload images to remote server
- Custom image size / thumbnail – Crop to aspect ratio even when source image is smaller than set dimensions
- Each custom image size in custom upload directory?
- Getting Images from theme’s directory in pages
- Add an alignment option for images
- How to delete resized (cropped) image uploads and prevent future resizing?
- How to automatically add rounded corners to thumbnails?
- Download an image from a webpage to the default uploads folder
- Add image size where largest possible proportional size is generated
- WP 4.4. responsive images browser choosing the “wrong” one
- After Moving a Site to Another Domain, All Images Are Lost
- Prevent WordPress from adding image’ title automatically
- Overide Gallery Default Link to Settings
- Retrieve featured image
- How to change image type for specific size?
- Add new image size to media uploader so users can insert into post?
- How to insert pictures without hard coded dimensions?
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords