Skip to content

Commit 813c1a2

Browse files
authored
Update static options prototype to include props param (#6452)
The static options field can either be a concrete options object or a generator function which accepts props as parameter. Unfortunately, static fields don't play well with TypeScript generics and the param was left as `any`.
1 parent 85264c1 commit 813c1a2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/src/interfaces/NavigationComponent.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ export class NavigationComponent<Props = {}, State = {}, Snapshot = any> extends
1818
State,
1919
Snapshot
2020
> {
21-
static options?: (() => Options) | Options;
21+
/**
22+
* Options used to apply a style configuration when the screen appears.
23+
*
24+
* This field can either contain the concrete options to be applied, or a generator function
25+
* which accepts props and returns an Options object.
26+
*/
27+
static options: ((props?: any) => Options) | Options;
2228

2329
componentDidAppear(_event: ComponentDidAppearEvent) {}
2430
componentDidDisappear(_event: ComponentDidDisappearEvent) {}

0 commit comments

Comments
 (0)