From 37fa8e39d439f0c7008d777e6dc98af889357755 Mon Sep 17 00:00:00 2001 From: Toru Kobayashi Date: Thu, 13 Jun 2019 08:05:52 +0900 Subject: [PATCH] fix(flux): fix types for createFunctional (#36023) --- types/flux/lib/FluxContainer.d.ts | 2 +- types/flux/test/FluxUtils.tsx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/types/flux/lib/FluxContainer.d.ts b/types/flux/lib/FluxContainer.d.ts index e4cdadf555..848836a072 100644 --- a/types/flux/lib/FluxContainer.d.ts +++ b/types/flux/lib/FluxContainer.d.ts @@ -45,7 +45,7 @@ export function create(base: Component( - viewFn: (props: TProps) => React.ReactElement, + viewFn: (props: TState) => React.ReactElement, getStores: (maybeProps?: TProps, maybeContext?: any) => Array>, calculateState: (prevState?: TState, maybeProps?: TProps, maybeContext?: any) => TState, options?: RealOptions diff --git a/types/flux/test/FluxUtils.tsx b/types/flux/test/FluxUtils.tsx index 0619be57b6..8604662eb7 100644 --- a/types/flux/test/FluxUtils.tsx +++ b/types/flux/test/FluxUtils.tsx @@ -65,14 +65,14 @@ const ContainerComponent3 = Container.create(CounterContainer, { w ; // Functional flux container with Store -const FunctionalContainerComponent = Container.createFunctional( - (props) => { +const FunctionalContainerComponent = Container.createFunctional( + (props: State) => { return
- {props.a} {props.b} + {props.counter}
; }, - () => [Store], - (prevState) => ({ counter: Store.getState() }) + (props: Props) => [Store], + (prevState: State, props: Props) => ({ counter: Store.getState() }) ); -; +;