You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在GetStream React应用中禁用消息输入框的EmojiPicker

如何在GetStream React应用中禁用EmojiPicker

有两种直接有效的方式可以完全禁用EmojiPicker:

方法1:通过组件属性直接关闭表情选择器

给MessageInput组件传递showEmojiPicker: false属性,这会同时隐藏输入栏的表情触发按钮,并彻底禁用EmojiPicker功能:

import { MessageInput } from 'stream-chat-react';

// 在你的组件中使用
<MessageInput showEmojiPicker={false} />

如果是在Channel组件中使用默认输入栏,可通过Channel的Input传入配置:

import { Channel } from 'stream-chat-react';

<Channel
  Input={(props) => <MessageInput {...props} showEmojiPicker={false} />}
>
  {/* 其他Channel子组件 */}
</Channel>

方法2:自定义工具栏移除表情按钮

如果需要更灵活的自定义,可替换默认工具栏,不渲染表情触发按钮:

import { MessageInput, Toolbar } from 'stream-chat-react';

const CustomToolbar = (props) => {
  // 仅保留需要的功能按钮,移除表情按钮
  return (
    <Toolbar
      {...props}
      renderEmojiPickerTrigger={() => null}
    />
  );
};

// 使用自定义工具栏
<MessageInput Toolbar={CustomToolbar} />

内容的提问来源于stack exchange,提问作者Zealand

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 09:24:50