use-auth0-hooks icon indicating copy to clipboard operation
use-auth0-hooks copied to clipboard

feat: improve types

Open goszczynskip opened this issue 5 years ago • 5 comments

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.

goszczynskip avatar Dec 19 '19 12:12 goszczynskip

We would love this feature :)

Mad-Kat avatar Mar 12 '20 14:03 Mad-Kat

+1 @sandrinodimattia Can we have this merged, please? It would save me from quite some ugly typecasting...

davguij avatar Apr 11 '20 13:04 davguij

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.

use-auth0-hooks+0.7.0.patch.zip

garry-jeromson avatar Apr 14 '20 14:04 garry-jeromson

@sandrinodimattia is there a plan to merge this PR?

Vbubblery avatar Jun 07 '20 20:06 Vbubblery

This will be really nice to have

4vanger avatar Jun 18 '20 18:06 4vanger