So I'm trying to build a modal in react and integrate it into a non-react website. I understand that I might need to export the app as a UMD and include it as an embed script into the host website.
But how do I interact with the modal within the host website ie open a modal when a button is clicked and close the modal when a button is clicked within the modal.
Solution
It's unclear what you're trying to do, have react in just some place in an existing website ? You could just render you react app into a div and have it live there.
const element = <h1>Hello, world</h1>;
ReactDOM.render(element, document.getElementById('root'));
Even though if you plan on doing it this way, vue might be better suited.
Alternative
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.