currentViewIndex always returns 0 regardless of which item is selected in listView

I am trying to set a temporary state value to the currently selected i value.

Is currentViewIndex supposed to return the current i value?

You can use

Thanks but that is how to get value from a component.

I want to get the i value of a listview.

Got it to work using a combo of the suggestion here.

I set a hidden text input default value I wanted to {{[i] }}

Then in my event handler I set the temporary state to the text input, then in my API query I am using the temporary state directly instead of trying to get the index from temporary state and setting value in query with {{[temporaryIndex.value] }}