Is better two re-renders or a loop?

Viewed 9

just curious about one performance question. For e.g: I want to add two rows in a table, this can be done by dispatching an action to reducer. Options:

  1. I can dispatch two actions and get two new rows in the table (2 re-renders).
  2. I can dispatch one action with rows count which then inside reducer does a loop (2times) and adds two rows in the table.

What do you think? :)

0 Answers
Related