Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

feat: improve types #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

goszczynskip
Copy link

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.

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.
@Mad-Kat
Copy link

Mad-Kat commented Mar 12, 2020

We would love this feature :)

@davguij
Copy link

davguij commented Apr 11, 2020

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

@garry-jeromson
Copy link

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

@Vbubblery
Copy link

@sandrinodimattia is there a plan to merge this PR?

@4vanger
Copy link

4vanger commented Jun 18, 2020

This will be really nice to have

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants