We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Explain how to use withSelect
import { withSelect } from '@wordpress/data'; const ImageInfiniteEditorWithSelect = (props) => { const { attributes: { blockClass, media, }, } = props; return ( <div className={blockClass}> { media.map((item) => { return (<ImageEditor blockClass={blockClass} url={item} />) }) } </div> ); }; export const ImageInfiniteEditor = withSelect( (select, props) => { const { attributes: { media, }, } = props; const images = media.map((item) => { const image = wp.data.select('core').getMedia(item); if (typeof image !== 'undefined') { return image.source_url; } }); return { attributes: { media: images, }, } })(ImageInfiniteEditorWithSelect);
The text was updated successfully, but these errors were encountered:
I'd add this to es docs plus a separate how-to article.
Sorry, something went wrong.
iruzevic
No branches or pull requests
Explain how to use withSelect
The text was updated successfully, but these errors were encountered: