Closed jb41997 closed 1 year ago
getAuth is definitely not a hook - https://stackblitz.com/github/reactive/data-client/tree/master/examples/github-app?file=src%2Fresources%2FAuth.ts It doesn't call any other hooks and isn't prefixed with 'use'.
However, useSuspense() is definitely a hook, so if you want to use that you can follow this guide to using any hook with a class component!
Feel free to pace your stack trace if this is wrong though!
@ntucker I really appreciate the pointer.
React version (React version (18.2.0)
**TypeScript version (5.0.3)
Rest Hooks version (latest)
Describe the bug I'm trying to implement a similar authentication check as the Github Demo uses. See the
base.ts
.However,
getAuth()
is a react hook and cannot be called in a class component. At least that is the error I'm receiving. Does anyone have a a good example of how to accomplish this or something similar? How to inherit check auth on every endpoint/resource?