I'm unsure why this is giving me an error I know there's something I'm meant to do but I can't figure out what to tell it not to give me an error. If I run it, it gives me an error BUT it does actually still work so the value does log in the console.
const Tab1: React.FC = () => {
const [lockdownData, setLockdownData] = useState();
useEffect(() => {
let finalLockdownData: any;
var getLockdownData = async () => {
await firestoreDB.collection("LockdownStatus").doc("lockdownData").get().then((doc) => {
finalLockdownData = doc.data();
});
setLockdownData(finalLockdownData);
};
getLockdownData();
}, []);
console.log('Position 1')
console.log(lockdownData?.level) //ERROR: Property 'level' does not exist on type 'never[]'.ts(2339)
console.log('Position 2')
return (