diff --git a/example/StackNavigator.tsx b/example/StackNavigator.tsx
index be176c60..59974c39 100644
--- a/example/StackNavigator.tsx
+++ b/example/StackNavigator.tsx
@@ -106,6 +106,22 @@ export default function StackNavigator(props: Props) {
{descriptors[route.key].render()}
))}
+
+ {
+ descriptors[navigation.state.routes[navigation.state.index].key]
+ .options.title
+ }
+
);
}
diff --git a/example/index.tsx b/example/index.tsx
index 9863501d..6e513b9f 100644
--- a/example/index.tsx
+++ b/example/index.tsx
@@ -89,9 +89,9 @@ function App() {
return (
-
-
-
+
+
+
{() => (
diff --git a/src/Screen.tsx b/src/Screen.tsx
index b967c6d6..e4c4c62a 100644
--- a/src/Screen.tsx
+++ b/src/Screen.tsx
@@ -1,6 +1,8 @@
+import { Options } from './types';
+
export type Props = {
name: string;
- options?: object;
+ options?: Options;
} & (
| { component: React.ComponentType }
| { children: (props: any) => React.ReactNode });
diff --git a/src/types.tsx b/src/types.tsx
index bae1b43f..59dec4ad 100644
--- a/src/types.tsx
+++ b/src/types.tsx
@@ -36,7 +36,12 @@ export type NavigationProp<
state: Route | NavigationState;
};
-export type Descriptor = {
+export type Descriptor = {
render(): React.ReactNode;
options: Options;
};
+
+export type Options = {
+ title?: string;
+ [key: string]: any;
+};