Starting with WordPress 5.0, React is made available as a dependency we can load in our WordPress themes and plugins. When we make the Element (React) library available, WordPress will load it into the global window object as window.wp.element….
Source: https://javascriptforwp.com/enqueue-react-in-wordpress/