Stimulus Discourse

Problem: Reading Initial State from the DOM


#1

I am completely silly please delete this thread for me.

I wasn’t reading correctly:
One way might be to load the initial index with an HTML data attribute. For example, we could add a data-slideshow-index attribute to the controller’s element:

<div data-controller="slideshow" data-slideshow-index="1">

I was adding data-slideshow-index in the individual slides. Complete goof.