React Error

'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.ts(2686)
'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.ts(2686)
I am getting this error in an extremely simple page (using pages router)
const ModifyAchievements = () => {
return <div>Hello World!</div>;
};

export default ModifyAchievements;
const ModifyAchievements = () => {
return <div>Hello World!</div>;
};

export default ModifyAchievements;
I have no idea why it wants me to import React when in all my other pages (probably 30+) it doesn't ask me to. I have tried restarting typescript server multiple times. Note: The page runs perfectly and does not give any console errors I have no idea why it is detecting an error.
Solution:
Solved it, I guess typescript was just being stupid with that file (I had to delete it and recreate it for anyone who runs into this issue).
Jump to solution
1 Reply
Solution
Codex
Codex4mo ago
Solved it, I guess typescript was just being stupid with that file (I had to delete it and recreate it for anyone who runs into this issue).
Want results from more Discord servers?
Add your server