Arrow Functions and binding in render : React


Yesterday I was reading some articles on React to learn more about good react coding patterns so that I can make my mobile app, which I am currently working on, fast and smooth. One of the coding tips I learnt is to avoid defining arrow functions and using bind in render function. Because see, render function is called frequently and one arrow function or bind in it may not cause a huge performance issue, but if our component is extended by a child component, then render function of the parent component will be called even when the child component is called, which can cause performance issue in the long run.

So to avoid such problem, try avoiding bind and arrow functions in render(). To know more about this refer –¬†https://medium.freecodecamp.org/why-arrow-functions-and-bind-in-reacts-render-are-problematic-f1c08b060e36


Afraid of getting married? Let's overcome it. Kirlian Photography