We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d28bd99 commit 6ba38fdCopy full SHA for 6ba38fd
2 files changed
src/wizard.tsx
@@ -11,7 +11,7 @@ const Wizard: React.FC<WizardProps> = React.memo(
11
const hasNextStep = React.useRef(true);
12
const hasPreviousStep = React.useRef(false);
13
const nextStepHandler = React.useRef<Handler>(() => {});
14
- const stepCount = React.Children.count(children);
+ const stepCount = React.Children.toArray(children).length;
15
16
hasNextStep.current = activeStep < stepCount - 1;
17
hasPreviousStep.current = activeStep > 0;
test/useWizard.test.tsx
@@ -12,6 +12,7 @@ const renderUseWizardHook = (initialStartIndex = 0) => {
wrapper: ({ children, startIndex }) => (
<Wizard startIndex={startIndex}>
<p>step 1 {children}</p>
+ {false && <p>Optional step</p>}
<p>step 2 {children}</p>
</Wizard>
18
),
0 commit comments