Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: catch missing params when they are required in navigate (faceboo…
…k#8389) There is a problem with the enforcement of required params in `navigation.navigate(...)` in TypeScript as described in react-navigation/react-navigation#7936 @Miyou found a fix 🥳. All credits go to him. I needed this so went ahead and submitted a PR and added a test to avoid it from breaking in the future. However note that until this project switches to TypeScript 3.9 with support for [`@ts-expect-error`](https://devblogs.microsoft.com/typescript/announcing-typescript-3-9-beta/#ts-expect-error-comments), it can still break silently. Before the change, this is how the test looks: <img width="861" alt="Screenshot 2020-06-05 at 22 51 00" src="https://user-images.githubusercontent.com/57791/83923057-c53dc180-a781-11ea-8c35-36406a23a717.png"> As you can see it doesn't catch the missing params which are required on line 28. After the change, all expected errors are raised: <img width="812" alt="Screenshot 2020-06-05 at 22 51 59" src="https://user-images.githubusercontent.com/57791/83923413-80665a80-a782-11ea-8ff2-f5af3f4e1f32.png"> Let me know what you think.
- Loading branch information