frontend/src/components/Home.js
// once the session is created, the page will redirect to the new meeting room
once the session is created, the page will redirect to the new meeting room
once the session is created the page will redirect to the new meeting room
function Home() {
  const history = useHistory();
  const clickHandler = async () => {
    const result = await createSession();
    history.push(`/meeting/${result.data.sessionRef}`)
  }
  return (
    <Flex
      h="100%"
      alignItems="center"
      justifyContent="center"
    >
      <Box textAlign="center">
        <Heading mb={10}>Welcome</Heading>
        <Button
          size="large"
          variant="solid"
          variantColor="green"
          p={4}
          rounded={30}
          onClick={clickHandler}
        >
          Create New Meeting
        </Button>
      </Box>
    </Flex>
  );
}
function Home ( ) { const history = useHistory ( ) ; const clickHandler = async ( ) => { const result = await createSession ( ) ; history . push ( ` ${ result . data . sessionRef } ` ) } return ( < Flex h = "100%" alignItems = "center" justifyContent = "center" > < Box textAlign = "center" > < Heading mb = { 10 } > Welcome < / Heading > < Button size = "large" variant = "solid" variantColor = "green" p = { 4 } rounded = { 30 } onClick = { clickHandler } > 
          Create New Meeting
         < / Button > < / Box > < / Flex > ) ; }
once the session is created, the page will redirect to the new meeting room
once the session is created the page will redirect to the new meeting room