title: How to keep the index in a React.useState?
body: <p>I have an index on my map function on the <code>image</code> and I want to keep that in a <code>useState</code> <code>const [selectedIndex, setSelectedIndex] = React.useState()</code> because I want to use it for a ternary operator. But how do i do that?</p>