jcmcneal / react-step-wizard

A modern flexible step wizard component built for React.
MIT License
583 stars 126 forks source link

Typescript: Added React.ReactElement type as a possibility for StepWizardProps children #85

Closed LucasCostaAtCyberSaint closed 3 years ago

LucasCostaAtCyberSaint commented 3 years ago

when using typescript, currently one is not able to pull the <StepWizard> props out for any children directly when destructuring. For example:

 <StepWizard>
      {(stepWizzardProps: StepWizardChildProps) => (
          <Step1
              someProp={true}
              anotherProp={"here"}
              onNextClick={stepWizzardProps.nextStep}
            />
            <Step2 />
      )}
</StepWizard>

// Step1.ts
type Step1Props = {
  someProp: boolean;
  anotherProp: string;
  onNextClick: () => void;
}

const Step1 = ({ someProp, anotherProp, onNextClick } : Step1Props) => {
  return (
    <div>
      <button onClick={onNextClick}>Click Me</button>
    </div>
  );
};
LucasCostaAtCyberSaint commented 3 years ago

Is there someone that can look at this? Who can I contact about it?

LucasCostaAtCyberSaint commented 3 years ago

Anyone there? 😢

jcmcneal commented 3 years ago

Sorry for the delay. I haven't been active on here in a while.