From 9ba5f4e1af18d8f24d7d36da32af36491bb2b99b Mon Sep 17 00:00:00 2001 From: Junaid Alam <77203021+Junaid2003@users.noreply.github.com> Date: Fri, 14 Jul 2023 18:38:31 +0530 Subject: [PATCH] Create CreateRoom.js updated code updated createRoom.js file according to latest code --- CreateRoom.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 CreateRoom.js diff --git a/CreateRoom.js b/CreateRoom.js new file mode 100644 index 0000000..6dc0843 --- /dev/null +++ b/CreateRoom.js @@ -0,0 +1,19 @@ +//Updated the CreateRoom.js file according to latest code +import React from "react"; +import { v1 as uuid } from "uuid"; +import { useNavigate } from "react-router-dom"; + +const CreateRoom = (props) => { + const navigate = useNavigate(); + + function create() { + const id = uuid(); + navigate(`/room/${id}`); + } + + return ( + + ); +} + +export default CreateRoom;