Next.js Discord

Discord Forum

useChat() resets message history given to it via `initialMessages`.

Unanswered
Red harvester ant posted this in #help-forum
Open in Discord
Red harvester antOP
I am providing a single message in the initialMessages option of useChat(). It renders correctly, but when I use the append method provided by useChat, it resets the messages list to an empty array. What could be causing this? This only happens when I specify messages in the initialMessages array, messages added subsequently using append() persist.

0 Replies