Skip to content

Commit 50f9e95

Browse files
authored
Merge pull request #262 from kaseyvee/text-input
fix(baseInput): avoid multiple fetch requests
2 parents 85e4d5d + 3ef39a0 commit 50f9e95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/input/baseInput/baseInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ function showEmojiInfo(emoji: EmojiInfo) {
4545
}
4646
}
4747

48+
const database = new Database()
49+
4850
/**
4951
* The `TextInput` component enables users to input text messages and send them over a WebSocket connection. It provides functionality for sending messages with a sender, timestamp, and conversation ID. The component integrates with the [emoji-picker-element](https://www.npmjs.com/package/emoji-picker-element) library to allow users to easily add emojis to their messages. The emoji picker can be customized through CSS variables. For detailed customization options, refer to the [emoji-picker-element documentation](https://www.npmjs.com/package/emoji-picker-element#css-variables).
5052
*
@@ -115,8 +117,6 @@ function BaseInputElement(
115117
setIsEmojiMenuShown(false)
116118
}
117119

118-
const database = new Database()
119-
120120
function searchEmojis(query: string) {
121121
database
122122
.getEmojiBySearchQuery(query)

0 commit comments

Comments
 (0)