-
Couldn't load subscription status.
- Fork 699
Description
Describe Your Environment
What version of Spectacle are you using? (can be found by running npm list spectacle)
Fresh clone & install of 8dac6a3
(by the way this is broken too. had to manually install pnpm)
yarn add pnpm
npx pnpm install
npx pnpm start:jsWhat browser are you using?
Tested on Firefox and Chrome
What machine are you on?
macOS and android
Describe the Problem
True of any slideshow I try, including the examples in the repository:
Opening a slideshow and navigating to another slide, eg. http://localhost:3000/?slideIndex=2&stepIndex=0, and then refreshing will take me back to the 0th slide. Going to the link directly also boots me back to the beginning of the slideshow. This sort of sucks a lot and breaks one of the major reasons why I use this -- being able to link directly to specific slides.
I think it might have something to do with slide 0, step 0 being hardcoded in the deck's usage of location sync....
spectacle/packages/spectacle/src/components/deck/deck.tsx
Lines 281 to 287 in 8dac6a3
| useEffect(() => { | |
| const initialView = syncLocation({ | |
| slideIndex: 0, | |
| stepIndex: 0 | |
| }); | |
| initializeTo(initialView); | |
| }, [initializeTo, syncLocation]); |
edit: was able to resolve the problem by reverting to the old style ReactDOM usage.
ie. rather than
import { createRoot } from 'react-dom/client';
const container = document.getElementById('root')
const root = createRoot(container);
root.render(<Presentation />);using
import ReactDOM from 'react-dom'
ReactDOM.render(<Presentation />, document.getElementById('root'))