Commit 5eb8bad9 authored by Kim, Chaerin's avatar Kim, Chaerin
Browse files

add key

parent a27376e3
...@@ -14,7 +14,7 @@ const INIT_ROOM = { ...@@ -14,7 +14,7 @@ const INIT_ROOM = {
const RoomSingle = () => { const RoomSingle = () => {
const [room, setRoom] = useState([INIT_ROOM]); const [room, setRoom] = useState([INIT_ROOM]);
const [error, setError] = useState(""); const [error, setError] = useState("");
const channelId = 'main'; const channelId = "main";
const { roomId } = useParams(room.roomId); const { roomId } = useParams(room.roomId);
async function getJoinRoom(Id) { async function getJoinRoom(Id) {
try { try {
...@@ -45,10 +45,13 @@ const RoomSingle = () => { ...@@ -45,10 +45,13 @@ const RoomSingle = () => {
{room && {room &&
room.map((el) => ( room.map((el) => (
<div> <div>
{room[0] === INIT_ROOM ? (<div></div>): ( {room[0] === INIT_ROOM ? (
<div></div>
) : (
<Link <Link
to={`/room/${el.roomId}/${channelId}`} to={`/room/${el.roomId}/${channelId}`}
className="text-decoration-none text-dark" className="text-decoration-none text-dark"
key={el.roomId}
> >
<div <div
className="d-flex mx-4 my-2 p-2" className="d-flex mx-4 my-2 p-2"
...@@ -74,7 +77,8 @@ const RoomSingle = () => { ...@@ -74,7 +77,8 @@ const RoomSingle = () => {
</div> </div>
<div className="ms-auto mt-2"> {el.member}/100 </div> <div className="ms-auto mt-2"> {el.member}/100 </div>
</div> </div>
</Link>)} </Link>
)}
</div> </div>
))} ))}
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment