Hi, I’m having trouble getting the okta-react library to work for me. when I try to access useOktaAuth() I get undefined returned. I’m following this tutorial: https://developer.okta.com/docs/guides/sign-into-spa/react/add-signin-button/
Most basic setup that should work:
import React, { useState, useEffect } from "react"
import { useOktaAuth } from "@okta/okta-react"
const AccountPage = () => {
console.log(useOktaAuth()) // => undefined
const { authState, authService } = useOktaAuth() // => TypeError: Cannot read property 'authState' of undefined
}
What am I missing here?