When to use setState() ? When we want to change the UI of the screen . We don’t need to call setState every time we change a variable. We call setState only when we want the change in a variable to reflect on the UI of the screen.
When to use setState() ? When we want to change the UI of the screen . We don’t need to call setState every time we change a variable. We call setState only when we want the change in a variable to reflect on the UI of the screen.