From 813c1a271225a802c9f828aae798a22c47e9752d Mon Sep 17 00:00:00 2001 From: Guy Carmeli Date: Sun, 2 Aug 2020 11:43:36 +0300 Subject: [PATCH] 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`. --- lib/src/interfaces/NavigationComponent.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/src/interfaces/NavigationComponent.ts b/lib/src/interfaces/NavigationComponent.ts index 408881416bb..4c4dd385d11 100644 --- a/lib/src/interfaces/NavigationComponent.ts +++ b/lib/src/interfaces/NavigationComponent.ts @@ -18,7 +18,13 @@ export class NavigationComponent 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) {}