getting error “TypeError: Cannot read properties of null (reading ‘useState’)” on useState usage react

If you are using Next 13 App router this could be happening if you are using an async function

Wrong:

"use client"

export default async function Page() {
    const [variable, setVariable] = useState();
}

Right:

"use client"

export default function Page() { //Remove Async Keyword
        const [variable, setVariable] = useState();
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)