Skip to content
This repository has been archived by the owner on Dec 3, 2022. It is now read-only.

Fix generic type of useNavigationParam #71

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

Conversation

avery-pierce
Copy link

This fixes an issue where the return type useNavigationParam wasn't meaningful (it just returns any).

Without generic (backwards compatibility):

Screen Shot 2021-03-03 at 3 08 07 PM

With generic (helpful type):

Screen Shot 2021-03-03 at 3 07 42 PM

As a side-effect, I think this also fixes #42 since you can now pass the P type in the useNavigation hook (it defaults to the unspecific NavigationParams type)

@avery-pierce avery-pierce changed the title Fix generic type of useNavigationParam refactor: Fix generic type of useNavigationParam Mar 3, 2021
@avery-pierce avery-pierce changed the title refactor: Fix generic type of useNavigationParam Fix generic type of useNavigationParam Mar 3, 2021
@Aure77
Copy link

Aure77 commented Feb 11, 2022

@slorber is this repository dead ?

@slorber
Copy link
Member

slorber commented Feb 16, 2022

@Aure77 yes, I don't have time to work on it so please reach out to other React-Navigation contributors to see if anyone is willing to backport changes to this older package

Remember that you can always fork and you are never 100% locked

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.

Types are missing and causing errors
3 participants