Fix navigation in UIExplorer. Use current index instead of fixed valu…
Summary:Motivation: After second navigation event in UIExplorer, content in main page always stayed the same. Fix: For second and future navigation events use stack.index to retrieve state from stack.children. Closes https://github.com/facebook/react-native/pull/6312 Differential Revision: D3018119 Pulled By: andreicoman11 fb-gh-sync-id: 4c502c42a0cb7b240e558515fb8fd766d6e1f856 shipit-source-id: 4c502c42a0cb7b240e558515fb8fd766d6e1f856
This commit is contained in:
parent
7ff938f8df
commit
11594b8531
|
@ -105,8 +105,10 @@ class UIExplorerApp extends React.Component {
|
||||||
}
|
}
|
||||||
const {stack} = navigationState;
|
const {stack} = navigationState;
|
||||||
const title = UIExplorerStateTitleMap(stack.children[stack.index]);
|
const title = UIExplorerStateTitleMap(stack.children[stack.index]);
|
||||||
if (stack && stack.children[1]) {
|
const index = stack.children.length <= 1 ? 1 : stack.index;
|
||||||
const {key} = stack.children[1];
|
|
||||||
|
if (stack && stack.children[index]) {
|
||||||
|
const {key} = stack.children[index];
|
||||||
const ExampleModule = UIExplorerList.Modules[key];
|
const ExampleModule = UIExplorerList.Modules[key];
|
||||||
const ExampleComponent = UIExplorerExampleList.makeRenderable(ExampleModule);
|
const ExampleComponent = UIExplorerExampleList.makeRenderable(ExampleModule);
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue