So I was looking at react and thinking if I was able to add react into my code on playcanvas
Make sure that they are the browser compiled version (not module, npm or anything else).
And also make sure in your project settings, at the script order list, you put those libraries to load first. That is important so they are available to be used in your scripts.
This is an old article but explains how to use a complex framework like Ionic (Angular) with Playcanvas: