File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
packages/web/src/views/Onboarding/components Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 1- import React , { useEffect , useRef , useState } from "react" ;
1+ import React , { useState } from "react" ;
22import styled from "styled-components" ;
33import { useOnboardingShortcuts } from "../hooks/useOnboardingShortcuts" ;
44
@@ -158,19 +158,13 @@ export const Onboarding: React.FC<Props> = ({
158158 } ;
159159
160160 const currentStep = steps [ currentStepIndex ] ;
161- const StepComponent = currentStep ?. component ;
162-
163- if ( ! StepComponent ) {
164- return null ;
165- }
166-
167161 // Get navigation control from step configuration
168162 const preventNavigation = currentStep . preventNavigation || false ;
169163 const isNextBtnDisabled = currentStep . nextButtonDisabled || false ;
170164 const canNavigateNext = currentStep . canNavigateNext !== false ; // Default to true
171165 const handlesKeyboardEvents = currentStep . handlesKeyboardEvents || false ;
166+ const StepComponent = currentStep ?. component ;
172167
173- // Use the keyboard shortcuts hook
174168 useOnboardingShortcuts ( {
175169 onNext : handleNext ,
176170 onPrevious : handlePrevious ,
@@ -180,6 +174,10 @@ export const Onboarding: React.FC<Props> = ({
180174 disablePrevious : currentStep . disablePrevious || false ,
181175 } ) ;
182176
177+ if ( ! StepComponent ) {
178+ return null ;
179+ }
180+
183181 // Handle navigation control changes from steps
184182 const handleNavigationControlChange = ( shouldPrevent : boolean ) => {
185183 setIsNavPrevented ( shouldPrevent ) ;
You can’t perform that action at this time.
0 commit comments