I was trying the useEffect example something like below:
import React , {useState , useEffect} from 'react'
import axios from 'axios'
function Homescreen() {
useEffect(async() => {
  
try {
  const data = (await axios.get('/api/rooms/getallrooms')).data
console.log(data)
return data;
} catch (error) {
  console.log(error)
}
}, [])
  
  return (
    <div>
        <h1>Home Screen</h1>
    </div>
  )
}
export default Homescreen
This is the warning poped up,
It looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
useEffect(() => {
  async function fetchData() {
    // You can await here
    const response = await MyAPI.getData(someId);
    // ...
  }
  fetchData();
}, [someId]); // Or [] if effect doesn't need props or state
 
     
    