import {useState} from 'react'; export default function JoinRoomForm({socket} : {socket: SocketIOClient.Socket}) { const [name, setName] = useState(''); const [password, setPassword] = useState(''); const [waiting, setWaiting] = useState(false); const [error, setError] = useState(''); return ( <>

Join Room

setName(e.target.value)} disabled={waiting} /> setPassword(e.target.value)} disabled={waiting} /> {waiting && 'Joining room...'}

{error}

); };