Skip to content

Deprecate methods from useNavigation hook #55

@jpgarcia

Description

@jpgarcia

Description

The createNavigationCommands used to expose helper methods as part of the useNavigation includes certain methods that does not require the componentId parameter.

As those methods are exposed as useNavigation hook you may end up providing an unnecessary dependency if you're using a useCallback for a handler which is not actually required as you can just Navigation.showModal which is static.

Proposal

  • Move useful helper methods setRoot, showModal and showOverlay away from createNavigationCommands and export them as helpers from 'react-native-navigation-hooks'
    import { setRoot, showModal, showOverlay } from 'react-navigation-hooks'
  • Add deprecation warning to the following methods in createNavigationCommands:
    • setRoot
    • showModal
    • showOverlay
    • setDefaultOptions
    • dismissAllModals
    • getLaunchArgs
  • Remove the deprecated methods in the next major release

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions