This issue is often related to your ESLint configuration not properly recognizing JSX syntax. Ensure that the eslint-plugin-react and eslint-plugin-react-hooks are installed and included in the plugins array in your .eslintrc.js. Also, check that your eslint.validate settings in VS Code or your editor include javascriptreact and typescriptreact if you're using TypeScript.