Site icon Catch Themes

WordPress Gutenberg Blocks query a table inside React JSX?

I did a custom wpdb query in plugin init.php : $wpdb->get_results(...query); but I can't use the php code inside my registered Gutenberg block's edit() function, because it is React JSX code... how do I pass my data results to my React Gutenberg BLock inside edit() or save() function? edit: maybe I am thinking too hard.. it's basically just normal React Code, so I guess I can also use a custom sql library from npm registry, and just import it and use it inside react to do a normal SQL query, correct?
Exit mobile version