Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
tratando de implementar una biblioteca talks.js para crear chat en reaccionar

Estoy tratando de implementar una biblioteca talks.js para crear un chat al reaccionar. Sigo todos los pasos que aparecen aquí https://talkjs.com/docs/Getting_Started/Frameworks/React/ pero no funciona, no lo sé. lo que me estoy perdiendo

Estoy exportando este componente a continuación e importando en el componente de inicio

 import { useRef } from 'react'; import Talk from 'talkjs'; const UserChat = () => { const talkjsContainer = useRef('root'); // const currentUser = this.props.currentUser; useEffect(() => { Talk.ready.then(( ) => { var me = new Talk.User({ id: '123456', name: 'Alberto', email: 'alice@example.com', photoUrl: 'https://demo.talkjs.com/img/alice.jpg', welcomeMessage: 'Hey there! How are you? :-)', }); window.talkSession = new Talk.Session({ appId: 'tUOOCMxO', me: me, }); var other = new Talk.User({ id: '654321', name: 'Sebastian', email: 'Sebastian@example.com', photoUrl: 'https://demo.talkjs.com/img/sebastian.jpg', welcomeMessage: 'Hey, how can I help?', role: 'default', }); var conversation = window.talkSession.getOrCreateConversation( Talk.oneOnOneId(me, other) ); conversation.setParticipant(me); conversation.setParticipant(other); var inbox = window.talkSession.createInbox(); inbox.select(conversation); inbox.mount(talkjsContainer.current) }); }, []); return( <div ref={talkjsContainer}></div> ) } export default UserChat;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

puedes usar esto

 const startChat = (user) => { if (!window.talkSession ) { return false; } const other = new Talk.User({ id: "1222222", name: "james", email:"james1@yandex.com", role: buyer }); const conversation = window.talkSession.getOrCreateConversation(Talk.oneOnOneId(me, other)); conversation.setParticipant(me); conversation.setParticipant(other); const popup = window.talkSession.createPopup(conversation, { keepOpen: false }); popup.mount({ show: false }); popup.show(); };
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!