DEV Community

Rajan lagah
Rajan lagah

Posted on

Optimize React app...

Every time I click + button it trigger re-render and intilizeState function is called again on every re-render.


Now notice i have just passed function ( not function's return value ) and even after clicking 10 times it ran the intilizeState function only once.

This is how we can use this technique optimize React app 😊

Top comments (0)