Set state inside a function

2 posts were merged into an existing topic: Set state code block