Skip to content

Commit

Permalink
Update static options prototype to include props param (#6452)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
guyca committed Aug 2, 2020
1 parent 85264c1 commit 813c1a2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/src/interfaces/NavigationComponent.ts
Expand Up @@ -18,7 +18,13 @@ export class NavigationComponent<Props = {}, State = {}, Snapshot = any> extends
State,
Snapshot
> {
static options?: (() => Options) | Options;
/**
* Options used to apply a style configuration when the screen appears.
*
* This field can either contain the concrete options to be applied, or a generator function
* which accepts props and returns an Options object.
*/
static options: ((props?: any) => Options) | Options;

componentDidAppear(_event: ComponentDidAppearEvent) {}
componentDidDisappear(_event: ComponentDidDisappearEvent) {}
Expand Down

0 comments on commit 813c1a2

Please sign in to comment.