Nice trick there with the memoization. Never thought of using it this way. I have seen developers taking the dependency array for granted and these were not beginners. Interestingly beginners seem to forget about dependency far less and that too due to a mistake. The ones that were doing this, were seasoned (as in they have been programming for a while now) developers ignoring the dependency array and I am really against this practice. If something doesn't seem to be going wrong just by looking at the application now, doesn't mean it never will or there aren't some unnecessary re-renders taking place. Its really nice to see someone paying attention to it, realising its importance and using it cleverly to his/her advantage.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice trick there with the memoization. Never thought of using it this way. I have seen developers taking the dependency array for granted and these were not beginners. Interestingly beginners seem to forget about dependency far less and that too due to a mistake. The ones that were doing this, were seasoned (as in they have been programming for a while now) developers ignoring the dependency array and I am really against this practice. If something doesn't seem to be going wrong just by looking at the application now, doesn't mean it never will or there aren't some unnecessary re-renders taking place. Its really nice to see someone paying attention to it, realising its importance and using it cleverly to his/her advantage.