To eliminate the intermediary, you have the option to perform the calculation while rendering or pass an index to a function that will return an object to generate your desired style.
totalItems.map((item, index) => {
<li style={animationDelay: `${.25 * index}s`}>{item.name}</li>
})
Alternatively, you can define a function to create and return the style object based on the index provided.
const style = (index) => {
return {
animationDelay: `${.25 * index}s`
}
}
If you prefer using styled components, you can pass in your component along with an attribute of index={the index of the item}
const StyledLink = styled(component here)`
animationDelay: ${props => props.index};
`;