Merge pull request #86 from WanQuanXie/list-map-key-fix

fix(Chat): list map element must specify a unique key
This commit is contained in:
ItzCrazyKns 2024-05-08 12:56:00 +05:30 committed by GitHub
commit 17fbc28172
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
'use client';
import { useEffect, useRef, useState } from 'react';
import { Fragment, useEffect, useRef, useState } from 'react';
import MessageInput from './MessageInput';
import { Message } from './ChatWindow';
import MessageBox from './MessageBox';
@ -53,7 +53,7 @@ const Chat = ({
const isLast = i === messages.length - 1;
return (
<>
<Fragment key={msg.id}>
<MessageBox
key={i}
message={msg}
@ -67,7 +67,7 @@ const Chat = ({
{!isLast && msg.role === 'assistant' && (
<div className="h-px w-full bg-[#1C1C1C]" />
)}
</>
</Fragment>
);
})}
{loading && !messageAppeared && <MessageBoxLoading />}