Skip to content

Cannot add HxCarouselItem by a loop #957

Answered by hakenr
alpachinois asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think this is about the HxCarousel[Item]. You can't use the loop variable i directly in lambda expressions or nested RenderFragments. Try adding var index = i; as the first line inside the for loop, and then use index variable instead of i everywhere (for example, if (index % 2 == 0)).

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by hakenr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #956 on December 02, 2024 22:16.