File tree Expand file tree Collapse file tree 2 files changed +1
-11
lines changed Expand file tree Collapse file tree 2 files changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { EditorProps, EditorStep } from "../mini-editor"
33import { InnerCode , updateEditorStep } from "./code"
44import { Preview , PresetConfig } from "./preview"
55import { extractPreviewSteps } from "./steps"
6- import { useInitialState } from "utils"
76
87export function Slideshow ( {
98 children,
@@ -50,11 +49,8 @@ export function Slideshow({
5049
5150 const maxSteps = editorSteps . length - 1 ;
5251
53- // This hook will prevent the slide from being changed via the start prop after render
54- const initialSlideValue = useInitialState ( start ) ;
55-
5652 // Make sure the initial slide is not configured out of bounds
57- const initialSlide = initialSlideValue > maxSteps ? maxSteps : initialSlideValue
53+ const initialSlide = start > maxSteps ? maxSteps : start
5854
5955 const [ state , setState ] = React . useState ( {
6056 stepIndex : initialSlide ,
Original file line number Diff line number Diff line change @@ -5,12 +5,6 @@ export const useLayoutEffect =
55 ? React . useLayoutEffect
66 : React . useEffect
77
8- // Returns the same state, even if the state argument changes.
9- export function useInitialState < T > ( value : T | ( ( ) => T ) ) {
10- const [ initialState ] = React . useState ( value ) ;
11- return initialState ;
12- }
13-
148// for debugging:
159// export const useLayoutEffect = (
1610// effect: any,
You can’t perform that action at this time.
0 commit comments