I have developed a React app using CRA and I'm trying to host it on existing wix page. With WIX I can use javascript files so I bundled my application code with dependencies into one file and tried copying and pasting react and react-dom code from its official cdn into my directory.
Somehow it's still not working, in react-dom.js I see error:
'window' is not defined
While right now I try to import only with react and react-dom, the problem applies in general to importing js frontend libraries into WIX.
I need application code to be hosted inside wix page but I think it should work fine if I add app dependencies using cdns from an iframe, a bit like in this topic then refer to it using wix syntax
let React = $w("#elementid").window.React;
to get the iframe, and from there to get React/other library reference. iFrame (WIX HTML element) is hosted in the same origin.
I can also use node.js code and npm modules listed here
Thoughts?