use-auth0-hooks
use-auth0-hooks copied to clipboard
feat: improve types
withLoginRequired and withAuth weren't typed properly. Their parameters required ClassComponents. Using FunctionalComponents weren't possible previously. This commit changes their parameters to ComponentType. It accepts class components and function components.
Returned values are typed properly too. withAuth returns same component type that was passed as a param. withLoginRequired adds optional path property.
We would love this feature :)
+1 @sandrinodimattia Can we have this merged, please? It would save me from quite some ugly typecasting...
For anyone looking for a short-term solution until the pull request is (hopefully) merged, attached is a patch file to be used with patch-package.
@sandrinodimattia is there a plan to merge this PR?
This will be really nice to have