From 1f46cfa22e8e73750a6067d2e1c113286f20d529 Mon Sep 17 00:00:00 2001 From: CodeCraftPro Date: Wed, 18 Mar 2026 12:02:16 +0000 Subject: [PATCH] fix(react): pass number instead of array as setTimeout delay --- .codesandbox/tasks.json | 57 +++++++++++++++++++ .../react/src/views/ChatInput/ChatInput.js | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .codesandbox/tasks.json diff --git a/.codesandbox/tasks.json b/.codesandbox/tasks.json new file mode 100644 index 000000000..1fa079181 --- /dev/null +++ b/.codesandbox/tasks.json @@ -0,0 +1,57 @@ +{ + // These tasks will run in order when initializing your CodeSandbox project. + "setupTasks": [ + { + "command": "yarn install", + "name": "Installing Dependencies" + }, + { + "command": "yarn dev", + "name": "yarn dev" + } + ], + + // These tasks can be run from CodeSandbox. Running one will open a log in the app. + "tasks": { + "preinstall": { + "name": "preinstall", + "command": "yarn preinstall", + "runAtStart": false + }, + "postinstall": { + "name": "postinstall", + "command": "yarn postinstall", + "runAtStart": false + }, + "build": { + "name": "build", + "command": "yarn build", + "runAtStart": false + }, + "lint": { + "name": "lint", + "command": "yarn lint", + "runAtStart": false + }, + "build:storybook": { + "name": "build:storybook", + "command": "yarn build:storybook", + "runAtStart": false + }, + "format": { + "name": "format", + "command": "yarn format", + "runAtStart": false + }, + "format:check": { + "name": "format:check", + "command": "yarn format:check", + "runAtStart": false + }, + "prepare": { + "name": "prepare", + "command": "yarn prepare", + "runAtStart": false + } + } +} diff --git a/packages/react/src/views/ChatInput/ChatInput.js b/packages/react/src/views/ChatInput/ChatInput.js index e753b689a..fa384cb3a 100644 --- a/packages/react/src/views/ChatInput/ChatInput.js +++ b/packages/react/src/views/ChatInput/ChatInput.js @@ -261,7 +261,7 @@ const ChatInput = ({ scrollToBottom, clearUnreadDividerRef }) => { typingRef.current = true; timerRef.current = setTimeout(() => { typingRef.current = false; - }, [15000]); + }, 15000); await RCInstance.sendTypingStatus(username, true); } else { clearTimeout(timerRef.current);