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"
3
3
import { InnerCode , updateEditorStep } from "./code"
4
4
import { Preview , PresetConfig } from "./preview"
5
5
import { extractPreviewSteps } from "./steps"
6
- import { useInitialState } from "utils"
7
6
8
7
export function Slideshow ( {
9
8
children,
@@ -50,11 +49,8 @@ export function Slideshow({
50
49
51
50
const maxSteps = editorSteps . length - 1 ;
52
51
53
- // This hook will prevent the slide from being changed via the start prop after render
54
- const initialSlideValue = useInitialState ( start ) ;
55
-
56
52
// 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
58
54
59
55
const [ state , setState ] = React . useState ( {
60
56
stepIndex : initialSlide ,
Original file line number Diff line number Diff line change @@ -5,12 +5,6 @@ export const useLayoutEffect =
5
5
? React . useLayoutEffect
6
6
: React . useEffect
7
7
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
-
14
8
// for debugging:
15
9
// export const useLayoutEffect = (
16
10
// effect: any,
You can’t perform that action at this time.
0 commit comments