ChildComponent will be doing requests using useQuery, useQueries, etc. Sometimes those requests will return with an authorization error. In those cases, I want to monitor that happened and then render the NoAuthFallbackPage component instead of children in the PermissionGate component.PermissionGate component and see if we're getting an authorization error from the backend in our response body, but I'm not sure of the best way to do that. Here are solutions I've considered:PermissionGate component but it appears this is meant to be run "outside" of the React runtime.ErrorBoundary. I was able to get this to work by essentially making the PermissionGate component an ErrorBoundary. Then, by passing throwOnError: true as an option to my queries in my ChildComponents, I could check the error that was thrown and if it contained the authorization code, I'd render the NoAuthFallbackPage component instead. So far this seemed to be the easiest method to get working.https://x.com/tan_stack/status/2031128535470104577?s=20
dry-scarlet · 2h ago
https://x.com/powersync_/status/2010721010006552775?s=20
dry-scarlet · 2mo ago
You can now submit your website/app/project to http://TanStack.com 's new showcase and have it seen by the TanStack community! - Global showcase browser - Per-library filters - Category filters Submit here: https://tanstack.com/showcase/submit View all here: https://tanstack.com/showcase
dry-scarlet · 3mo ago