Commit Graph

7 Commits

Author SHA1 Message Date
Hedger Wang 614f3c68e6 Add `NavigationStateUtils.back()` and `NavigationStateUtils.forward()`.
Summary: This makes it easy to build Pager.

Reviewed By: ericvicenti

Differential Revision: D3479979

fbshipit-source-id: 71c0536eb190e8ad64feea99e4bda5e2d28801d2
2016-06-24 15:28:35 -07:00
Hedger Wang 67002e8ae3 Clean up NavigationStateUtils
Summary:
== API Breaking Change ==

- Add unit tests to ensure that NavigationStateUtils does the right thing.
- Remove the logics that lets NavigationStateUtils accept empty value as input
  and return a new state.
- Remove the method `NavigationStateUtils.getParent`, `NavigationStateUtils.set`. These methods are rarely used and they can be replaced by other methods.

Reviewed By: ericvicenti

Differential Revision: D3374934

fbshipit-source-id: 0fdf538d014d7c5b4aa1f15a0ee8db9dc91e33cd
2016-06-08 15:13:31 -07:00
Hedger Wang 1e626027f5 Rename `navigationState.children` to `navigationState.routes`.
Summary:
[Experimental API breaking changes]

The notion of `parent` or `children` in navigaton is misleading. We have no intention to maintain or
build the nested or hierarchical navigation states. To be clear, rename `navigationState.children` to
`navigationState.route`.

Reviewed By: ericvicenti

Differential Revision: D3332115

fbshipit-source-id: c72ed08acaf030fb9c60abf22fb15cc0f44b3485
2016-05-22 16:28:27 -07:00
Christoph Pojer d363b1f2e2 Update Jest APIs on fbsource
Reviewed By: javache

Differential Revision: D3229435

fb-gh-sync-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c
fbshipit-source-id: b0e252d69e1f399a946fca6e98ef62ff44c2ef9c
2016-04-27 19:16:32 -07:00
Pieter De Baets 21ee7fde6e Fix mocks in NavigationExperimental
Summary:Fixes mocking in NavigationExperimental tests and manually mock React to make things pass
Closes https://github.com/facebook/react-native/pull/6124

Differential Revision: D2970955

fb-gh-sync-id: ece45f1193a23a39d49fb9c2f529e1d709189f31
shipit-source-id: ece45f1193a23a39d49fb9c2f529e1d709189f31
2016-02-24 05:11:28 -08:00
Eric Vicenti a91466f84a Rename NavigationState module to NavigationStateUtils
Summary: There is a NavigationState type within this module so the name cannot be shared

Reviewed By: hedgerwang

Differential Revision: D2938311

fb-gh-sync-id: c5208755c9dfa5bf0e67666957c01e203ddd4218
shipit-source-id: c5208755c9dfa5bf0e67666957c01e203ddd4218
2016-02-19 01:24:54 -08:00
Eric Vicenti a3085464f6 NavigationExperimental
Summary:
A new API to unify internal navigation. Also addresses a highly-rated community 'pain': https://productpains.com/post/react-native/better-navigator-api-and-docs/

Offers the following improvements:

- Redux-style navigation logic is easy to reason about
- Navigation state can be easily saved and restored through refreshes
- Declarative navigation views can be implemented in native or JS
- Animations and gestures are isolated and now use the Animated library

public

Reviewed By: hedgerwang

Differential Revision: D2798048

fb-gh-sync-id: 88027ef9ead8a80afa38354252bc377455cc6dbb
2016-02-05 14:26:35 -08:00