Ecommerce Shopify WordPress Discussion

How to open the WordPress Media Library popup in next js app?

// If the media frame already exists, reopen it. if (file_frame) { file_frame.open(); return; } // Create the media frame. file_frame = wp.media.frames.downloadable_file = wp.media({ title: 'Choose file', button: { text: 'Use file' }, multiple: false }); // When an image is selected, run a callback. file_frame.on('select', function () { var attachment = file_frame.state().get('selection').first().toJSON(); console.log(attachment); }); // Finally, open the modal. file_frame.open(); After doing some RnD, I have found this in the web. But it does not work inside nextjs/react app. It works with JQuery perfectly fine if I place this outside of the nextjs app. if you are wondering which popup I am talking about, take a look at this image- Wordpress Media Library Popup I want to show the mentioned popup inside my nextjs app and handle upload image in here.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.