[wp-trac] [WordPress Trac] #45271: Can't enqueue WordPress 5.0 builtin reactjs

WordPress Trac noreply at wordpress.org
Sun Nov 4 06:26:43 UTC 2018


#45271: Can't enqueue WordPress 5.0 builtin reactjs
-------------------------------+-------------------------
 Reporter:  CantoThemes        |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  5.0
Component:  General            |     Version:  5.0
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  javascript
-------------------------------+-------------------------

Comment (by pento):

 Thanks for the extra information, @CantoThemes.

 Here's a sample that works for me:

 {{{#!php
 <?php
 add_action( 'admin_menu', function() {
         $hook = add_menu_page( 'Test', 'Test', 'read', 'my-test', function
 () {
                 echo 'test';
         } );

         add_action( "load-$hook", function () {
                 wp_enqueue_script( 'react' );
                 wp_enqueue_script( 'react-dom' );
         } );
 } );
 }}}

 I see you're running the 5.0 nightly build: could I get you to update your
 install? I've just rebuild the nightly, to ensure it's up to date.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45271#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list