Can you explain why you also used the memo hook? It seems to me the point of clarity you made and the unnecessary use of useReducer was somewhat obfuscated by that sneaky little inclusion ;)
I'm a web developer and consultant, web GDE, and author of open source libraries. I co-founded 500Tech, a company that specializes in frontend technologies. I love coding, and love speaking about code
Can you explain why you also used the memo hook? It seems to me the point of clarity you made and the unnecessary use of useReducer was somewhat obfuscated by that sneaky little inclusion ;)
Hi,
not trying to be sneaky, just concise :)
But if that's confusing I'll add a note to the article
I wanted to show 2 equivalent solutions, and because dispatch never changes I wanted to ensure that actions never change with useMemo