@applicaster/zapp-react-native-ui-components 12.0.0-rc.86 → 12.0.0-rc.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,7 @@ import { ScreenDataContext } from "@applicaster/zapp-react-native-ui-components/
8
8
  import { PathnameContext } from "@applicaster/zapp-react-native-ui-components/Contexts/PathnameContext";
9
9
 
10
10
  import { Screen } from "../Screen/TV/index.web";
11
+ import { isLast } from "@applicaster/zapp-react-native-utils/arrayUtils";
11
12
 
12
13
  type Components = {
13
14
  NavBar: React.ComponentType<any>;
@@ -19,21 +20,26 @@ type Props = {
19
20
  };
20
21
 
21
22
  export const StackNavigator = ({ Components }: Props) => {
22
- const { mainStack, currentRoute } = useNavigation();
23
+ const { mainStack } = useNavigation();
23
24
 
24
- const renderScreen = ({ route, state }) => {
25
+ const renderScreen = ({ route, state }, index) => {
25
26
  const pathAttributes = getPathAttributes({ pathname: route });
26
27
 
27
28
  if (isEmpty(pathAttributes)) {
28
29
  return null;
29
30
  }
30
31
 
32
+ // HACK: Adding index to route to avoid conflicts in the navigator.
33
+ // Startup hooks are all using PUSH navigation action to navigate, but their routes are always like root routes.
34
+ // This means some hooks can have the same routes, e.g., ["hooks/context-setter", "/hooks/login-plug", "hooks/context-setter"].
35
+ const routeId = `${route}--${index}`;
36
+
31
37
  return (
32
38
  <FocusableGroup
33
39
  id={route}
34
- preferredFocus={route === currentRoute}
40
+ preferredFocus={isLast(index, mainStack.length)}
35
41
  excludeFromFocusSearching
36
- key={route}
42
+ key={routeId}
37
43
  >
38
44
  <ScreenDataContext.Provider value={state}>
39
45
  <PathnameContext.Provider value={route}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "12.0.0-rc.86",
3
+ "version": "12.0.0-rc.88",
4
4
  "description": "Applicaster Zapp React Native ui components for the Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -34,10 +34,10 @@
34
34
  "redux-mock-store": "^1.5.3"
35
35
  },
36
36
  "dependencies": {
37
- "@applicaster/applicaster-types": "12.0.0-rc.86",
38
- "@applicaster/zapp-react-native-bridge": "12.0.0-rc.86",
39
- "@applicaster/zapp-react-native-redux": "12.0.0-rc.86",
40
- "@applicaster/zapp-react-native-utils": "12.0.0-rc.86",
37
+ "@applicaster/applicaster-types": "12.0.0-rc.88",
38
+ "@applicaster/zapp-react-native-bridge": "12.0.0-rc.88",
39
+ "@applicaster/zapp-react-native-redux": "12.0.0-rc.88",
40
+ "@applicaster/zapp-react-native-utils": "12.0.0-rc.88",
41
41
  "promise": "^8.3.0",
42
42
  "react-router-native": "^5.1.2",
43
43
  "url": "^0.11.0",