I thought this would be easier, but I’m having issues doing this.
We’ve build a new website for our client, we use WordPress with Bedrock/Sage (basically no plugins, we code everything so there’s full control there).
I build a chatbot in React, using Node as a backend. Initially thought I could get away inserting it as an iFrame but this is causing me to use more hacks to get it to work properly than I’d like to. The chatbot goes fullscreen and there’s a minimize button etc. Doesn’t go well.
I’ve been trying to inject the build files into JavaScript for 2 hours now. Initially I dropped them into the project and tried it like that, didn’t work. We are hosting the chatbot on a seperate domain, so then I tried to inject these files but nothing seems to happen. No console.log errors either, the div with id=”root” just stays empty.
Does anyone have experience with this?
[ad_2]
You need to share the code that you used to do this. I don’t know much about how react works but my understanding is it’s just JavaScript so I can’t imagine why there would be any issue preventing you from integrating it into a page.
Proper way would be using inertiajs like laravel do.
edit: [maybe useful](https://medium.com/lagierandlagier/the-easiest-way-to-integrate-react-with-wordpress-3eab65638aa7)
Give up and use Meowapps.com/ai-engine? 😉