Closed valeadami closed 5 years ago
It sounds like you're not using a bundler. Can you share more of the project structure?
Sure! This is the structure:
Ah - you are looking to use this in your project, right - not develop this library?
What I'd recommend to get started with a really simple project that uses this library is:
npm install -g create-react-app
create-react-app valeadamis_app
cd valeadamis_app
npm install --save react-chat-window
yes, exactly, i need to use this project in order to evaluate react and integrate it in my express web app. Thanks for the suggestion!
Hi @dharness, got the create-react-app, it works! Now I downloaded the react-chat-window from npm, it is now in the modules folder (is that correct?). How do I make it as the main project? I'd like to see the chat window as soon as I hit localhost:3000. Thanks againg
Hi @valeadami! Yes, when you npm install
something without the -g
, it should go in your node_modules
.
From here, when you created the react app, it should have suggested that you run npm start
. If you do that and then look at localhost:3000
in your browser, it has a link to learn React - I think it would help you to go through some of the tutorials at that site! :)
To short cut, you should basically be able to:
Example
section of the readmesrc/App.js
, removing the line that duplicates the import
s from 'react'
messageHistory
with an empty array []
(that's a bug in the example, oops)import
the Launcher
from react-chat-window
instead of ../../src
(another bug)Then, if you see the line
class Demo extends Component {
--> That means you can make this "Demo" appear by adding <Demo />
to the render
function of the App
component. Try adding it in a few different places and see what works. It will show up as a little chat bubble that you need to click on to open the chat window.
Good luck!
thanks @heatherbooker it works,at last! Point 4 was the critical one for me. Thanks for your help
Hi, I ve just dowloaded this example from github. Run the npm install --save in a new folder. I 've just started the application and got into this error:
Do I need to change something? I am very new to React and I just need to try a working example to get started. I need a web chat, only the UI. Thakns for your attention