<button onClick={() => signIn()}>Login</button>
is triggering the @typescript-eslint/no-misused-promises
error message in VS Code, which states: Promise-returning function provided to attribute where a void return was expected.
I am currently following a tutorial at this link: https://youtu.be/nzJsYJPCc80?t=642 and interestingly, the error doesn't seem to appear there
This project was initiated using
npm create t3-app@latest <project-name>
and included all components such as trpc, tailwind, next-auth, and prisma (everything that create-t3-app offers).
Should I simply disable this eslint error with
/* eslint-disable @typescript-eslint/no-misused-promises */
as mentioned in the "Quick Fix"? Or should I consider making adjustments to the default .eslintrc.json file provided by create-t3-app?
Your guidance on this matter would be greatly appreciated 🙏
// src/pages/index.tsx
import { type NextPage } from "next";
import Head from "next/head";
import Link from "next/link";
import { signIn, signOut, useSession } from "next-auth/react";
import { api } from "../utils/api";
const Home: NextPage = () => {
return (
<>
<Head>
<title>Create T3 App</title>
<meta name="description" content="Generated by create-t3-app" />
<link rel="icon" href="/favicon.ico" />
</Head>
<div>
<button onClick={() => signIn()}>Login</button>
</div>
</>
);
};
export default Home;