I tried Googling my way to a solution but haven’t found any issues similar to mine. I’m following this article just to get a cool little app running. Everything was working fine until I got to the section about the login button component.
Following a roughly 2-year old article might be my first mistake, but I also noticed that importing things from ‘@okta/okta-react’ gives me this in VSCode:
Man, what a find. You’re a lifesaver. So you followed the original article as well? How might the LoginButton.js component look different, for example? Should I refactor the component to more closely resemble what might be seen here? :
I wasn’t following that article specifically, but a similar one that was also outdated. I think that refactor would work with the LoginButton component outlined in the article you’re following! Basically replace calls/references to this.props.auth.something with authState and authService depending on the use case.
Perfect. Here’s some of what LoginButton.js looks like after updating with the changes. Posting for those who might also be following the original article:
I get the same error - “TypeError: Object(…) is not a function” when using the hooks useOktaAuth() in the above code. As soon as useOktaAuth() is removed, the error is gone. can you reproduce?