Skip to content

[react-navigation] Loosen navigator navigationOptions#24943

Merged
RyanCavanaugh merged 2 commits intoDefinitelyTyped:masterfrom
doomsower:react-navigation-loose-options
Apr 17, 2018
Merged

[react-navigation] Loosen navigator navigationOptions#24943
RyanCavanaugh merged 2 commits intoDefinitelyTyped:masterfrom
doomsower:react-navigation-loose-options

Conversation

@doomsower
Copy link
Copy Markdown
Contributor

This is a common use case for me. I have TabNavigator inside StackNavigator and I want to set navigationOptions on tab navigator as If it is just a regular screen of stack. Current definitions won't let me do that, because NavigationTabRouterConfig limits navigationOptions. This problem is illustrated by lines added to test file.

This PR resolves this problem by loosening navigationOptions on tab and stack router. I took a liberty here and completely redefined NavigationScreenOptions type to be a union type, because 1) It's the best name for union type 2) Previous NavigationScreenOptions were just one-liner `{title?: string} and they're highly unlikely to be used on it's own, outside tab or stack navigator options.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • Increase the version number in the header if appropriate.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }.

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Apr 12, 2018

@doomsower Thank you for submitting this PR!

🔔 @huhuanming @mhcgrq @fangpenlin @petejkim @iRoachie @phanalpha @charlesfamu @timwangdev @BANG88 @svbutko @levito @robertohuertasm @YourGamesBeOver @ArmandoAssuncao @cliedeman - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Apr 17, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience!

@RyanCavanaugh RyanCavanaugh merged commit a9e8ad8 into DefinitelyTyped:master Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Unmerged The author did not merge the PR when it was ready.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants