dharness / react-chat-window

Intercom-style live chat window written in react
The Unlicense
671 stars 250 forks source link

How can i import into a plain html file? #142

Closed juzejunior closed 4 years ago

juzejunior commented 4 years ago

Recently i need it to import this component into a non react project, like a simple html page, how can i do this? It's possible? I've been tryin' to import UMD file generated, but it does not work.

NaumanMoazzam commented 4 years ago

If you want to add into simple HTML page;

  1. Clone this project.
  2. Run npm install/ yarn then npm start/ yarn start
  3. After successful start, run npm build. This will create a build folder with CSS & JS folder.
  4. Copy these files into your HTML page, and add a div with ID anywhere in the code, for example:

    And import all the CSS & JS.

  5. This will add chat widget into your simple HTML page.
heatherbooker commented 4 years ago

Hi @juzejunior, I don't think you can actually use a react component in a non-react project, sorry - you will have to look for plain javascript solutions or perhaps find a jquery based library to rely on. Good luck!