From 212eb0cf156db1752a3dd137fb113d3a2a544d3d Mon Sep 17 00:00:00 2001 From: Ben Hodgson Date: Fri, 19 Apr 2019 00:15:50 +0100 Subject: [PATCH] [react-albus] Define WithWizard render prop component (#34823) Fixes Error: `Module '"node_modules/@types/react-albus"' has no exported member 'WithWizard'. Did you mean 'withWizard'?"` https://github.com/americanexpress/react-albus/blob/master/src/index.js#L18 --- types/react-albus/index.d.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/types/react-albus/index.d.ts b/types/react-albus/index.d.ts index ccc0ac8582..1efe74318f 100644 --- a/types/react-albus/index.d.ts +++ b/types/react-albus/index.d.ts @@ -41,15 +41,19 @@ export interface WizardProps { export const Wizard: React.ComponentType; +export type WizardContextRenderProps = + | { render?: (wizard: WizardContext) => React.ReactNode } + | { children: (wizard: WizardContext) => React.ReactNode }; + +export const WithWizard: React.ComponentType; + export interface StepsProps { step?: StepObject; } export const Steps: React.ComponentType; -export type StepProps = StepObject & ( - | { render?: (wizard: WizardContext) => React.ReactNode } - | { children: (wizard: WizardContext) => React.ReactNode }); +export type StepProps = StepObject & WizardContextRenderProps; /** * In addition to id, any additional props added to will be available on each step object.