danpersa/ascii-diag

Avoiding too many function calls in React

danpersa opened this issue · 0 comments

Don't use functions in react components, as they are called on every render.

Examples of functions which are called too many times:

isConnectorToolButtonSelected
isSelectToolButtonSelected
isTextToolButtonSelected
isBoxToolButtonSelected
shouldShowBoxOptions
shouldShowConnectorOptions

Instead