import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom' import roomApi from '../../apis/room.api'; import userApi from '../../apis/user.api'; const RoomSingle = () => { const [roomNum, setRoomNum] = useState([]) const [room, setRoom] = useState([]) const id = localStorage.getItem('user'); const channelId = 1 async function getJoinRoom(id) { try { const User = await userApi.getUser(id) setRoomNum(User.data.roomNumber) const Room = await roomApi.getRoom(roomNum) } catch (error) { // catchErrors(error, setError) } } useEffect(() => { getJoinRoom(id) }, [id]) return (