import Talk from 'talkjs';
import { useCallback } from 'react';
function Chat() {
const syncUser = useCallback(
() =>
new Talk.User({
id: 'nina',
name: 'Nina',
email: 'nina@example.com',
photoUrl: 'https://talkjs.com/new-web/avatar-7.jpg',
welcomeMessage: 'Hi!',
}),
[]
);
return (
<Session appId="tPKdyezd" syncUser={syncUser}>
// UI component will go here...
</Session>
);
}
export default Chat;
import { Session, Chatbox } from "@talkjs/react";
<Session appId="t824ba8" userId="pete">
<Chatbox conversation="workshop" className="chatbox"/>
</Session>