I'm trying to update the state inside useEffect hook but the state is not updating
const [course, setCourse] = useState("loading");
useEffect( () => {
const fetchData = async () => {
await setCourse("m");
console.log(`setCourse ${course}`);
};
fetchData();
}, []);
While printing in console it is showing loading but I want to print "m".