Is it possible to load a remote js file through the script tag and treat it as React component.
Assuming that I build a project that contains a react component:
<ExampleComp var={value} />
And I am accessing the bundle js file (built from the other project ) in the destination project:
<script type="text/javascript" src="/path/to/script.js"></script>
In the destination project, is it possible to treat the component included in the bundle js file as a react component such that I can interact with it like a normal React component:
<ExampleComp var={value} />
2
Answers
A quick search lead me this repository, maybe it can help you?
Looks to do more or less what you are asking for.
https://github.com/Paciolan/remote-component
maybe it can help you? tsconfig reference
https://www.typescriptlang.org/tsconfig/#references