Just coming back to this after doing more digging and finding this thread on how to integrate React and Sage11 - How to add React support in Sage 11 . I couldn’t get @wordpress/element to work, but after carrying out the steps in this guide, I’m getting somewhere.
I have a few questions, if anyone has the time to fill in a some gaps for me, I’d appreciate it…
During the setup process I installed @vitejs/plugin-react, react and react-dom - so my understanding is that this is full fat React, not WordPress’ bundled version of React (@wordpress/element) - whats the difference and is this better or worse?
What is @vitejs/plugin-react and what does it actually do?
I’m importing it into vite.config.js - does this bit: plugins: [react()] - actually load the plugin into Vite?
In my app.blade.php I’ve added @viteReactRefresh above the line that starts with @vite - whats that for?
Thank you!