diff --git a/packages/ibm-products/src/components/CreateFullPage/CreateFullPageStep.tsx b/packages/ibm-products/src/components/CreateFullPage/CreateFullPageStep.tsx index ddab7098a7..9d300f7516 100644 --- a/packages/ibm-products/src/components/CreateFullPage/CreateFullPageStep.tsx +++ b/packages/ibm-products/src/components/CreateFullPage/CreateFullPageStep.tsx @@ -97,13 +97,24 @@ interface CreateFullPageStepBaseProps extends PropsWithChildren { title: ReactNode; } +// Try to specify the hasFieldset and fieldsetLegendText Typescript requirements. +// Basically, fieldsetLegendText should only be specified when hasFieldset is true. +// And usually, hasFieldset won't be specified at all unless it's being set to true. type CreateFullPageStepFieldsetProps = + | { + // fieldsetLegendText should not be specified unless hasFieldset is true, but + // not sure how to do that in Typescript. + fieldsetLegendText?: string; + } | { hasFieldset: false; + + // fieldsetLegendText should not be specified unless hasFieldset is true, but + // not sure how to do that in Typescript. fieldsetLegendText?: string; } | { - hasFieldset?: true; + hasFieldset: true; fieldsetLegendText: string; }; @@ -271,7 +282,6 @@ CreateFullPageStep.propTypes = { /** * This will conditionally disable the submit button in the multi step CreateFullPage */ - /**@ts-ignore */ disableSubmit: PropTypes.bool, /** @@ -285,7 +295,6 @@ CreateFullPageStep.propTypes = { /** * This optional prop will render your form content inside of a fieldset html element */ - /**@ts-ignore */ hasFieldset: PropTypes.bool, /**