tencentcloud / chat-uikit-react Goto Github PK
View Code? Open in Web Editor NEWBuild In-App Chat & Audio/Video Call & Live Streaming in minutes with UIKit components for React
License: Apache License 2.0
Build In-App Chat & Audio/Video Call & Live Streaming in minutes with UIKit components for React
License: Apache License 2.0
下载的文件名称不是原始的文件名
ant design pro 接入demo时,报以下错误
Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.
import React, { useEffect, useState } from 'react';
import { TUIKit } from '@tencentcloud/chat-uikit-react';
import '@tencentcloud/chat-uikit-react/dist/cjs/index.css';
import TIM, { ChatSDK } from 'tim-js-sdk/tim-js-friendship';
import TIMUploadPlugin from 'tim-upload-plugin';
const init = async () => {
return new Promise((resolve, reject) => {
const tim = TIM.create({ SDKAppID: 0 });
tim?.registerPlugin({ 'tim-upload-plugin': TIMUploadPlugin });
const onReady = () => { resolve(tim); };
tim.on(TIM.EVENT.SDK_READY, onReady);
tim.login({
userID: 'xxx',
userSig: 'xxx',
});
});
}
export function SampleChat() {
const [tim, setTim] = useState<ChatSDK>();
useEffect(() => {
(async ()=>{
const tim = await init()
setTim(tim)
})()
}, [])
return (
<div style={{height: '100vh',width: '100vw'}}>
<TUIKit tim={tim}></TUIKit>
</div>
);
}
前端的一些数据需要存储在本地,你们是怎么做的?
在聊天中没有 聊天群的列表
能不能做一个缓存保持用户
在web端的聊天群中, 如何@某人
It's not working when searching to add a contact using Vite.
useConversationCreate.js:1 Uncaught (in promise) ReferenceError: process is not defined
at useConversationCreate.js:1:2258
at step (tslib.es6.mjs:147:21)
at Object.next (tslib.es6.mjs:128:51)
at fulfilled (tslib.es6.mjs:118:56)
(anonymous) @ useConversationCreate.js:1
step @ tslib.es6.mjs:147
(anonymous) @ tslib.es6.mjs:128
fulfilled @ tslib.es6.mjs:118
Promise.then (async)
step @ tslib.es6.mjs:120
(anonymous) @ tslib.es6.mjs:121
__awaiter @ tslib.es6.mjs:117
onChange @ ConversationCreateUserSelectList.js:1
onChange @ Input.js:1
callCallback2 @ react-dom.development.js:4164
invokeGuardedCallbackDev @ react-dom.development.js:4213
invokeGuardedCallback @ react-dom.development.js:4277
invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291
executeDispatch @ react-dom.development.js:9041
processDispatchQueueItemsInOrder @ react-dom.development.js:9073
processDispatchQueue @ react-dom.development.js:9086
dispatchEventsForPlugins @ react-dom.development.js:9097
(anonymous) @ react-dom.development.js:9288
batchedUpdates$1 @ react-dom.development.js:26140
batchedUpdates @ react-dom.development.js:3991
dispatchEventForPluginEventSystem @ react-dom.development.js:9287
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465
dispatchEvent @ react-dom.development.js:6457
dispatchDiscreteEvent @ react-dom.development.js:6430
There is only import.meta.env as I'm using Vite. And the process.env
would have error and crash this functionality to add contact.
However, I have to pre define a process
before use chat-uikit-react to make it works:
globalThis.process = globalThis.process || {}
在聊天群中,会偶尔查不到历史的消息
运行环境:
macos m1 版本 13.3.1
nodejs版本 v18.15.0
复现:
git clone https://github.com/TencentCloud/chat-uikit-react
cd chat-uikit-react
npm install && cd examples/sample-chat && npm install
npm run start
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.