Commit Graph

30 Commits

Author SHA1 Message Date
satyajit.happy
2eb86cd215 feat: add a setOptions method to set screen options
In React Navigation, the screen options can be specified statically. If you need to configure any options based on props and state of the component, or want to update state and props based on some action such as tab press, you need to do it in a hacky way by changing params. it's way more complicated than it needs to be. It also breaks when used with HOCs which don't hoist static props, a common source of confusion.

This PR adds a `setOptions` API to be able to update options directly without going through params.
2019-07-22 20:50:53 +02:00
satyajit.happy
2b819e4310 feat: improve types for options and support a function 2019-07-22 12:21:40 +02:00
satyajit.happy
57b7ed827c refactor: move some common actions to base router 2019-07-21 02:55:34 +02:00
Michał Osadnik
1de5494793 feat: add target argument to setParams (#18) 2019-07-20 20:51:03 +01:00
Michał Osadnik
4483dd2c3a feat: make NAVIGATE and JUMP_TO to support key and name of the route (#16) 2019-07-20 16:46:29 +01:00
Satyajit Sahoo
44b2ace9ee refactor: drop getStateForChildUpdate in favor of getStateForRouteFocus (#15) 2019-07-20 13:05:30 +01:00
Michał Osadnik
d3099c18b8 refactor: move navigation.state to a route prop (#6) 2019-07-18 15:14:47 +02:00
satyajit.happy
b775dbaacf feat: handle route names change 2019-07-18 14:47:04 +02:00
satyajit.happy
95773de0a3 refactor: create initial state only once 2019-07-17 12:38:04 +02:00
Michal Osadnik
ea8655252d feat: let child navigators handle actions from parent
Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
2019-07-17 12:36:55 +02:00
Michał Osadnik
f383d131d9 feat: add createNavigator and not export Screen directly (#3) 2019-07-17 00:11:53 +01:00
satyajit.happy
db6fe6bb1e refactor: add separate method for rehydration and fix types 2019-07-14 18:42:30 +02:00
satyajit.happy
43bc406c00 refactor: rename names to routeNames for clarity 2019-07-14 14:57:02 +02:00
satyajit.happy
86890b2b33 fix: merge params on navigate in example 2019-07-14 14:51:42 +02:00
satyajit.happy
eeccd1b1b5 docs: remove outdated comments 2019-07-12 22:47:06 +02:00
satyajit.happy
6686e0ab58 refactor: remove parent to child navigator communication 2019-07-12 22:41:48 +02:00
satyajit.happy
b58ea0ebeb fix: only propagate navigate to children 2019-06-13 10:28:04 +02:00
satyajit.happy
1c394e1279 feat: add more acttions 2019-06-12 00:01:13 +02:00
satyajit.happy
85e65d7bee fix: focus a navigator when you navigate to a screen in it 2019-06-11 23:28:17 +02:00
satyajit.happy
5c6ec4e1f2 feat: make actions work across navigators 2019-06-11 15:39:02 +02:00
satyajit.happy
14aa95515e feat: add typed navigator for better typechecking 2019-06-11 12:06:46 +02:00
satyajit.happy
b2214774d6 feat: add support for params 2019-06-11 10:30:50 +02:00
satyajit.happy
bf958e3c91 feat: respect key when reseting state 2019-06-10 16:37:19 +02:00
satyajit.happy
67b09da633 fix: don't perform side-effects in setState 2019-06-10 15:47:01 +02:00
satyajit.happy
33fd99c842 wip 2019-06-10 05:33:47 +02:00
satyajit.happy
57cfb9a512 feat: support options 2019-06-10 04:48:14 +02:00
satyajit.happy
44909bd80a refactor: minor tweaks 2019-06-10 01:57:42 +02:00
satyajit.happy
00fdd13356 docs: add info about how initial state is handled 2019-06-09 21:11:57 +02:00
satyajit.happy
0514ca7fca feat: add basic nesting example 2019-06-09 20:19:50 +02:00
satyajit.happy
fc1a4adc74 chore: initial POC 2019-06-09 19:37:23 +02:00